How to convert a Postman request to cURL Command


If you have an HTTP GET/POST or any other method request in the Postman and you want to convert it to a cURL command then you can follow the below steps.

  1. Make sure you are on the tab in which you want to get the cURL.
  2. Now locate the code icon at the top right </> and click on it.
  3. Make sure cURL is selected in the dropdown.
  4. Copy the snippet to the clipboard.
  5. And there you have the cURL for a request from Postman.
Example:
Postman request cURL Code snippet
curl --location 
--request POST 'http://localhost:8080/message?
user=101&date=2023-06-23&location=New%20York' \
--header 'Accept: application/json'

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap