wagng
wagng

Reputation: 711

how to convert curl command into postman

I am going to use mailgun api.

Here is the cRUL command working in terminal properly.

curl -s --user 'api:key-...' \
    https://api.mailgun.net/v3/DomainName/messages \
    -F from='Excited User <mailgun@DomainName>' \
    -F [email protected] \
    -F subject='Hello' \
    -F text='Testing some Mailgun awesomness!'

I can't make sense how I can run this command using Postman.

I tried to import cURL command into Postman but it doesn't import api:key. I really can't understand how I can import this api key into Postman to run the api properly.

Please help me to run this command using Postman.

Thank you!

Upvotes: 2

Views: 4717

Answers (2)

Voicu
Voicu

Reputation: 17850

For whoever wants to create the Postman request manually:

The --user (or -u) translates in Postman into Basic Auth Username and Password fields, which you find under the Authorization request nav option:

enter image description here

The -F (for form params) you add under Body request nav option, with x-www-form-urlencoded or form-data selected (if not sure which, check this question):

enter image description here

More on curl options here.

Upvotes: 2

Pratik Mandrekar
Pratik Mandrekar

Reputation: 9568

Try importing it like this

curl https://api:[email protected]/v3/DomainName/messages \
    -F from='Excited User <mailgun@DomainName>' \
    -F [email protected] \
    -F subject='Hello' \
    -F text='Testing some Mailgun awesomness!'

Upvotes: 0

Related Questions