UGandhi
UGandhi

Reputation: 579

Postman - 400 Bad Request

I am trying to hit API on Postman. The API is working on server but I am not receiving any data. Here are the visual images:

enter image description here

It is responding me with "No Data" and 400 Bad Request.

enter image description here

Upvotes: 4

Views: 33965

Answers (3)

user9363352
user9363352

Reputation:

There is only one thing you are missing.

  • Just put the body under raw instead of form-data

It will work.

Upvotes: 2

Danny Dainton
Danny Dainton

Reputation: 25851

I'm guessing it's this API: https://market.mashape.com/navii/daily-fuel-price-india#main-version

Postman

Add the Content-Type: application/json header instead of the one you have.

Postman_Header

And the body would be something like this:

enter image description here

Upvotes: 1

michali
michali

Reputation: 431

It's paid APIand I don't want to pay for it, so let me guess ;)

  1. Shouldn't you set 'Content-Type: application/json' ?
  2. Do you provide body in this request - I guess you should set something like this:

    {"fuel":"p","state":"dl"}

Upvotes: 1

Related Questions