Given a PHP source code with curl handle, how do I get the command line version of that curl request?
2 Answers
Look at the cURL documentation here:
http://curl.haxx.se/docs/manpage.html
or, go to your terminal and type:
man curl
After reading the documentation, you will have to manually find out which commands map to which functions to get the results you want. Unlikely to be any easier way to do this.
A lot of it will be just looking at which of PHP's curl_setopt() parameters map to the matching command line parameters.
Comments
You could just create a php file with the curl command in it, and then just run the php script from the command line.
hostname$ php curldownload.php
Or, you could have a look here for examples: http://www.thegeekstuff.com/2012/04/curl-examples/