PHP - Debugging Curl

后端 未结 8 1329
無奈伤痛
無奈伤痛 2020-11-21 11:35

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 am using is already made (not by me),

8条回答
  •  梦如初夏
    2020-11-21 11:52

    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.

提交回复
热议问题