Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I turn this curl request into Postman request

Tags:

curl

postman

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

like image 785
InvalidSyntax Avatar asked Aug 22 '17 10:08

InvalidSyntax


People also ask

Can I use curl in Postman?

Running curl Examples in PostmanPostman even allows you to import curl commands, so you can copy any curl samples in ShipEngine's documentation (such as the one above) and paste them into Postman.

How would you use curl to make a post request?

When the -F option is used, curl sends the data using the multipart/form-data Content-Type. Another way to make a POST request is to use the -d option. This causes curl to send the data using the application/x-www-form-urlencoded Content-Type.

Is postman same as curl?

Postman is a platform for testing APIs. cURL is a command-line utility that allows you to transmit data over URLs. To do the same operations with REST APIs, we may use Postman as a GUI (graphical user interface) and cURL as a CLI (command-line interface).


Video Answer


2 Answers

Import the cURL using Import->Paste Raw Text.

like image 81
Pratik Mandrekar Avatar answered Oct 23 '22 13:10

Pratik Mandrekar


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.

like image 36
davidethell Avatar answered Oct 23 '22 11:10

davidethell