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
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.
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.
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).
Import the cURL
using Import->Paste Raw Text
.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With