27

I am trying to request data using Postman instead of a terminal command provided by a Web Service's API documentation.

The curl command is as follows:

curl https://api.webservice.io \
-H 'Authorization:Bearer apikey1234567890' \
-H 'Accept: application/json'

How can I request this within Postman? I have tried adding Authorization:Bearer and Accept as request parameters but this does not work

InvalidSyntax
  • 9,131
  • 20
  • 80
  • 127

3 Answers3

59

Import the cURL using Import->Paste Raw Text.

Pratik Mandrekar
  • 9,362
  • 4
  • 45
  • 65
1

In your Postman request you need to click the Headers tab and add two key/value pairs. Under the key column click "New key" text and enter "Authorization:Bearer" and enter your api key in the value column. Then you'll see another row where you can add your Accept key and "application/json" value.

davidethell
  • 11,708
  • 6
  • 43
  • 63
  • Sorry this is what I've done, but it doesn't work as it does in terminal.. It states the token is incorrect so I'm not sure if I'm adding the Authorization key incorrectly. – InvalidSyntax Aug 22 '17 at 10:29
1

Agree with @Pratik. I just append the step graph in the below.
import > Raw Text > Paste raw text > continue
enjoy it.

enter image description here

Zgpeace
  • 3,927
  • 33
  • 31