Reputation: 7761
I am calling my Java webservice (POST request) via Postman in the following manner which works perfectly fine (i.e. I can see my records getting inserted into the database):
And, here's how the contents inside the Headers(1)
tab look like:
Instead of calling it via Postman, I have to call the same request in PHP using cURL. I am wondering if there's a way to export this command to a curl
command so that I could use it in my PHP code? I have found the opposite approach at many places online where someone is asking to convert a curl based request to Postman but couldn't figure out how to do the opposite.
I found this question for curl to Postman: Simulate a specific CURL in PostMan
Upvotes: 763
Views: 735467
Reputation: 996
For those who use v7.36.5 for Ubuntu, or similar.
Instead of the </>
icon, there is a clickable "Code" text:
Upvotes: 14
Reputation: 15120
You can see the button </>
Code icon in right side of the Postman app (attached screenshot).
Press it and you can get your code in many different languages including PHP cURL
Upvotes: 1457
Reputation: 436
Steps:
</>
icon from right side barUpvotes: 10
Reputation: 1021
To extend the existing answers, there is an option to generate PHP ready cURL code if needed. With latest Postman, you will find dropdown for PHP - cURL and other languages.
See screenshot:
Upvotes: 4
Reputation: 595
The first answer here works with the older versions of Postman. With the latest releases in 2021 the cURL can be found clicking this icon (circled in red)
Upvotes: 38
Reputation: 417
If you're like me running MacOS and still have Postman v7, you have to click the ellipses here to find the code option
Upvotes: 8