manisha
manisha

Reputation: 57

"Post" method test result error in JMeter API testing

I tried to run a POST method for API testing in JMeter, I have sent the parameters as needed, but still it shows cannot post.

What should I do to make it work?

user add post request

response message

Upvotes: 0

Views: 1057

Answers (2)

user8279057
user8279057

Reputation:

In the post request, you need to provide server name or IP address and port number respectively. If it still doesn't work, try changing the path by adding /api then /user/data. it works in some cases. Hope this works out!

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168157

If you are testing an API my expectation is that you need to send either JSON or XML payload using "Body Data" tab of the HTTP Request sampler.

You will also need HTTP Header Manager to send the relevant Content-Type header

References:

Another way of building a web service test plan is executing the request(s) according to your test scenario using a 3rd-party tool like Postman or SoapUI and recording them via JMeter's HTTP(S) Test Script Recorder.

Upvotes: 1

Related Questions