4

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

UGandhi
  • 518
  • 1
  • 8
  • 28

3 Answers3

2

There is only one thing you are missing.

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

It will work.

1

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"}

michali
  • 401
  • 2
  • 11
  • I had already paid for it. I tried both of these points. Though, thank you for answering. It can help @Michali – UGandhi Feb 13 '18 at 04:44
1

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

Danny Dainton
  • 23,069
  • 6
  • 67
  • 80