vlatko606
vlatko606

Reputation: 1149

Jmeter - Bad request 400 received, although 200 is expected

I am trying to understand why i have Bad request when i called my api, but works perfectly fine when using Postman/Supertest(JS).

MY request is as: enter image description here

Headers as: enter image description here

Actual request as: enter image description here

Actual response: enter image description here

enter image description here

Although, the same request works perfectly fine using Postman. enter image description here

enter image description here

-I tried Fiddler as well, request seems totally identical, but the response different. enter image description here

-Using Jmeter v4, but the result is the same on 5.21

Any advice is much appreciated!

Upvotes: 0

Views: 1287

Answers (1)

Masud Jahan
Masud Jahan

Reputation: 2978

You are sending your request as body data with JMeter but in postman, you are sending it as form data. Check the postman headers accordingly.

enter image description here

In JMeter, for the form data, you have to check the Use multipart/form-data in your request sampler like this and add your parameters accordingly in the parameter tab instead of Body.

enter image description here

Upvotes: 1

Related Questions