3

I'm using this guide to send a multipart POST request to a server with JMeter: https://www.blazemeter.com/blog/testing-advanced-rest-api-file-uploads-jmeter

In this request there are several parts like a file, some strings and JSON.

The problem is, although I specify the boundary in the "Content type" field, JMeter set whatever it wants and the result is the server (Wildfly 10) correctly rejects the request with a "RESTEASY007500: Could find no Content-Disposition header within part".

Here the request configuration:

enter image description here

And here the generated request:

enter image description here

I set "jmeter_is_great" but JMeter generates a random boundary. Is someone having the same problem? Am i doing something wrong?

Thanks

UPDATE

I asked how to set the boundary because at the beginning of my test the first error throwed by the server was "RESTEASY007550: Unable to get boundary for multipart". So I added the "Content type" field, which can contain the boundary value, but that doesn't seem to work. I was not really interested to set a specific boundary at the beginning.

Now, I found a configuration which work although without specify the boundary, maybe someone can find it useful:

enter image description here

enter image description here

unveloper
  • 260
  • 1
  • 4
  • 12

2 Answers2

0

To validate if your server is handling invalid boundary using JMeter, unclick use mulitpart/form-data in your HTTP Request, set HTTP Header Manager with Content-type: multipart/form-data and then in your Body Data add the following:

--pZbVxWMEYBsPH
Content-Disposition: form-data; name="linkImage"
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit

true
--pZbVxWMEYBsPHPpbDCQQBUaAhIlYw0H
Content-Disposition: form-data; name="file"; filename="Small.png"
Content-Type: image/png
Content-Transfer-Encoding: binary

Ensure you dont have any Parameters or Files Upload set.

user1859465
  • 883
  • 1
  • 11
  • 28
-1

If you are building a multipart request manually make sure that Use multipart/form data for POST box is not checked under the HTTP Request sampler

JMeter uncheck multipart/form-data

Assuming it is done you can set your custom boundary using the HTTP Header Manager like:

JMeter Header Manager custom multipart boundary

Dmitri T
  • 159,985
  • 5
  • 83
  • 133