php cUrl to command line curl call php cUrl to command line curl call curl curl

php cUrl to command line curl call


You can use Chrome "Developer Tool" (Open with F11). Then you will see "network" tab.Open this before you visit wanted url.Inside this tab you will see all request to this domain. Click on the first request and on the right you will seeanother tabs "headers", "preview", "response", "cookies", "timing".In "headers" tab are headers sent in http for this page. This headers you can use in curl.

EDITED -> If communication is without UI, You need some proxy software like:http://proxyworkbench.com/


Steps

  1. install fiddler and enable it to listen to port 8888(by default)
  2. Change php server side curl domain code and make sure the new domain is pointing to localhost:8888. This way all traffic is routed through fiddler
  3. Capture the request and take a session copy
  4. compare the versions


Please note that the following answer is just a work-around, there's no such library for PHP (yet)!


You can convert cURL commands to PHP code with incarnate's cURL-to-PHP tool.It is available online at: https://incarnate.github.io/curl-to-php/

The converter logic is written in JavaScript, you can check it's source code on the project's git repository: https://github.com/incarnate/curl-to-php