cURL and Postman work wonderfully together
cURL is the most used command line tool for making API calls. However, it is a little cumbersome to work directly with cURL, since even a simple cURL request looks like this:
Postman has a nice UI, which makes it easy to add/remove parameters, changing things is more flexible. Postman also allows users to save requests etc, which cURL is not designed to do. In short, Postman allows a modern, simpler workflow.
The good news is, Postman can help make cURL easier to use. We do that in two ways.
- An easier way to create cURL commands.You can construct a request in Postman and convert it to cURL using the code snippet generator.
- Running cURL commands in a more user-friendly way.
You can import a cURL request into Postman and run it.
If you found this useful, you should also take a look at the other options in the code snipper generator. You can convert a request into many programming languages such as Go, Objective-C, Python, etc.
We aim to make Postman as flexible for your needs as possible. Do let us know if you’ve come up with cool use cases of the code snippet generator!
I don’t seem to be able to generate POST requests for Objective C with the code snippet generator. It just stays stuck at the previous language that was clicked on.
1) was just what i needed (for adding a test case to Jira) and I very much appreciate the feature.
But doesn’t Postman itself uses curl behind the curtain?
Thanks
https://blog.postman.com/curl-and-postman-work-wonderfully-together/
or you can execute curl commands directly from your browser on https://reqbin.com/curl
For those less familiar with Postman, the button to generate code snippets is described at https://learning.postman.com/docs/sending-requests/generate-code-snippets/
This doesn’t explain how to do what’s being asked. How do I create a cUrl request.
This post is about importing CURL commands into Postman, not creating them. If you want to learn more about CURL, I’d recommend this article: https://curl.se/docs/manpage.html
You can also generate CURL commands directly from Postman: https://learning.postman.com/docs/sending-requests/generate-code-snippets/#generating-code-snippets-in-postman
It would be great if we could have the CURL command with variable replaced ({gateawayId} and {{AccssToken}} in your example)
Some more information about how to fire a cURL request here would be REALLY helpful.