I have a multipart request that I construct. Each part of the request is a jsonString body and it has a set of headers for the whole request and some for individual multiaprts.
I can use jMeter's 'Send parameters with request' to add Name-value for the jsonStrings, but I cannot specify headers within each of these parts. I can specify a header manager for the entire request, but can it be specified for each of the multiparts as well?
Also, while specifying the content to upload, I have a file whose contents are compressed and encoded into bytes by a JSR223 Sampler and I would want this to be sent along with the request.
You can build the request manually, just take the following steps:
Use multipart/form-data for HTTP POST
box in the HTTP Request SamplerContent-Type
header with the value of multipart/form-data; boundary=your_custom_boundary
Switch to "Body Data" tab of the HTTP Request Sampler and construct your request body there separating each parameter set with
--your_custom_boundary
See Testing REST API File Uploads in JMeter guide for a little bit more detailed explanation and demo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With