270
votes

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):

enter image description here

And, here's how the contents inside the Headers(1) tab looks like:

enter image description here

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 curl command so that I could use it in my PHP code? I have found opposite approach at many places online where someone is asking to convert Curl based request to POSTMAN but couldn't figure out how to do the opposite.

Some articles I found for curl to postman

4
The last time I used Postman I remember it showed the curl command for cli somewhere. Regardless, using phpcurl to post a json body is quite straightforward. The json string as the postfield and set the appropriate headerfrz3993
Is there a way to do this for Insomnia?Anshuman Kumar

4 Answers

536
votes

enter image description here

You can see the button "Code" in the attached screenshot, press it and you can get your code in many different languages including PHP cURL

enter image description here

71
votes

Starting from Postman 8 you need to visit here

enter image description here

15
votes

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) enter image description here

2
votes

If you're like me running MacOS and still have Postman v7, you have to click the ellipses here to find the code option