Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jmeter 2.9 HTTP Sampler for PUT not passing parameters

I'm using Jmeter version 2.9, HTTP sampler to test my rest services.

The GET and POST are working without any issues, where as PUT is not passing any parameters in the request to the server.

I verified it with view results in tree.

Any reasons on why this is happening and work around this issue?

like image 725
Arun Avatar asked Aug 10 '13 16:08

Arun


2 Answers

It worked for me. Based on what I read on internet, there were different solutions suggested:

  • Changing Content-Encoding to UTF-8
  • Pass the PUT parameters in the "body data" tab (as opposed to passing them in tabular format in the "Parameters" tab)
  • Setting Content-Type header to application/json in the HTTP Header Manager
  • Passing the parameters via a file (even if this were to work, how would you pass dynamic values?)
  • passing it as POST with a combination of above points.

WHAT WORKED FOR ME is this combination: Set content type to application/json + Pass parameters as "JSON" in the **body data tab (below is an example)

I did not need to specify UTF-8 or anything else.

EXAMPLE JSON PARAMETER BODY: {"title":"JMeterTitle","preMortar":"JMeterPre","postMortar":"JMeterPost"}

like image 189
Sameer Rajimwale Avatar answered Oct 05 '22 09:10

Sameer Rajimwale


Pass parameters in path field using:

?name=value&name2=value2

and body in Raw Post body. if it doesn't work report a bug .

Example:

enter image description here

like image 37
UBIK LOAD PACK Avatar answered Oct 05 '22 09:10

UBIK LOAD PACK