PHP - Debugging Curl

后端 未结 8 1353
無奈伤痛
無奈伤痛 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 12:10

    Here is an even simplier way, by writing directly to php error output

    curl_setopt($curl, CURLOPT_VERBOSE, true);
    curl_setopt($curl, CURLOPT_STDERR, fopen('php://stderr', 'w'));
    

提交回复
热议问题