Jmeter 2.9 HTTP Sampler for PUT not passing parameters

I am using Jmeter version 2.9, HTTP sampler to test my leisure services.

GET and POST work without any problems when PUT does not pass any parameters in the request to the server.

I checked it with the search results in the tree.

Any reasons why this is happening and getting around this problem?

+6
source share
6 answers

It worked for me. Based on what I read on the Internet, various options were suggested:

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

WHAT WORKS FOR ME is a combination: Set the content type for the application / json + Transfer parameters as "JSON" in the body data ** strong> (below example)

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

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

+4
source

Pass the parameters to the path field using:

?

name = value & name2 = value2

and body in Raw Post body. if it does not work, report an error.

Example:

enter image description here

+1
source

First try looking through the logs.

There was a similar problem. I used the Content-enconding field incorrectly as an HTTP Content-Type parameter. They are not connected.

If you need to set Content-Type = application / json, you must use the "HTTP Header Manager" configuration item.

After properly configuring the contents associated with UTF-8, the launch request started to work.

jmeter

0
source

You must add a parameter with an empty name (on the Parameters tab).

If the problem persists, use the result tree view to analyze the query settings.

0
source

I am using JMeter 2.13 and am facing a similar problem. Here's how I solved it:

  • Setting the Content-Type header to text / plain in the HTTP header manager
  • Changing Content-Encoding to UTF-8
  • On the parameters tab, add parameters without a name and separate them with an ampersand (s)

JMeter PUT Script Example

Hope this helps!

0
source

I am using JMeter 2.11 and I had the same problem. I decided this way:

1) Setting the Content-Type header is similar to the one you use in your api method (example: application/json or application/x-www-form-urlencoded , etc.) in the HTTP header manager.

2) In an HTTP request. Body data should look like this:

KEY=VALUE&KEY=VLAUE&KEY=VLAUE&KEY=VLAUE.......

0
source

Source: https://habr.com/ru/post/951461/


All Articles