Monday, October 14, 2013

JMeter not sending body with the PUT method

Noticed very, very strange behavior. When we issue a PUT request with jMeter’s HTTP Sampler, it totally ignores what we have in Post Data or in the Raw Post Data section.
That’s kind of crazy, since I would expect PUT method to be an HTTP mutator as well, and where’s the state if we don’t send it?
However HTTP is OK, it’s rather issues of the jMeter or underlying libraries. In order to make PUT method send the POST body, one could simply set the encoding to UTF-8 (that’s the box exactly after the method dropdown. And it works. A kind of magic, but ate another 30 mins of my time.
I had that issue on jMeter 2.9, and it seems to be quite common since that’s the link where I have found the solution.

1 comment:

Paras said...

But adding UTF-8 does not solve my problem, where I am uploading a file.
I have recorded a request which uploads a file but the request fails everytime . It failed while recording as well