Using cURL commands in a REST client , without wanting to know cURL ;)

I am a newbie to cURL and dont understand cURL commands , neither have I used cURL to make REST API calls before.

Recently I encountered a situation where I had access to some cURL “code” and I had to use that perform some GET and POST operations on a REST end-point.

Due to lack of time ( and laziness) to learn cURL , I took a punt and started exploring as to whether the marvelous Postman tool had an easy way to convert cURL commands to some kind of REST API call structure .

And viola , Postman did not disappoint again , this can be achieved in a few clicks

Step 1 :: Find cURL commands that represent your code –

curl https://{subdomain}.{domain}.com/api/v2/groups.json \
  -H "Content-Type: application/json" -d '{"group": {"name": "My Group"}}'
  -v -u {email_address}:{password} -X POST

Step 2: Open Postman and click import (next to the “new” button)

Step 3: In the ensuing dialog box, choose the raw text tab and paste the cURL snippet

Step 4: Click import and there you have it , Postman has created a POST request with the desired end point & JSON payload from the cURL commands in a new tab . You can now tweak away and modify/run the call as you see fit 🙂

 

 

Leave a Reply