且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Php - 调试卷曲

更新时间:2023-02-24 15:29:26

您可以启用 CURLOPT_VERBOSE 选项:

  curl_setopt($ curlhandle,CURLOPT_VERBOSE,true); 

当设置 CURLOPT_VERBOSE STDERR 或使用 CURLOPT_STDERR 指定的文件。



您也可以使用tcpdump或wireshark来观看网络流量。


I'd like to see what the post fields in the request are before I send it. (For debugging purposes).

The php library (class) I'm using is already made (not by me), so I'm trying to understand it.

As far as I can tell, it uses curl_setopt() to set different options like headers and such and then it uses curl_exec() to send the request.

Ideas on how to see what post fields are being sent?

You can enable the CURLOPT_VERBOSE option:

curl_setopt($curlhandle, CURLOPT_VERBOSE, true);

When CURLOPT_VERBOSE is set, output is written to STDERR or the file specified using CURLOPT_STDERR. The output is very informative.

You can also use tcpdump or wireshark to watch the network traffic.