Php cUrl to invoke command line hangs

There are many threads when converting command-line hang commands to php cURL resources. I need to do the opposite. I am trying to debug some critical provider code and would like to make diff. Is it possible? In chrome, when a network request is run, you can copy the network request as a curl command (single line!). I hope php curl lib can offer something like this?

+7
php curl
source share
3 answers

Please note that the following answer is just a workaround, there is no such library for PHP (yet)!


You can convert cURL commands to PHP code using the cURL-to-PHP incarnation. It is available on the Internet at: https://incarnate.imtqy.com/curl-to-php/

The logic of the converter is written in JavaScript, you can check its source code in the repository of the git project: https://github.com/incarnate/curl-to-php p>

0
source share

You can use Chrome's "Developer Tool" (Open with F11). Then you will see the "network" tab. Open this before you visit the required URL. Inside this tab you will see the entire query in this domain. Click on the first request, and on the right you will see the other tabs "headers", "preview", "response", "cookies", "time". On the headers tab, headers are sent to http for this page. You can use these headers in curl.

EDITED → If the connection is without a user interface, you need proxy software, for example: http://proxyworkbench.com/

0
source share

Steps

  • install the script and enable it to listen on port 8888 (default)
  • Change the curl domain code on the php side and make sure the new domain points to localhost: 8888. Thus, all traffic is routed through fiddler
  • Capturing a request and getting a copy of a session
  • compare versions
-one
source share

All Articles