PHP, curl, and raw headers

后端 未结 4 1721
时光取名叫无心
时光取名叫无心 2020-12-13 13:05

When using the PHP curl functions, is there anyway to see the exact raw headers that curl is sending to the server?

4条回答
  •  被撕碎了的回忆
    2020-12-13 13:30

    You can use curl_getinfo:

    Before the call

    curl_setopt($ch, CURLINFO_HEADER_OUT, true);
    

    After

    $headers = curl_getinfo($ch, CURLINFO_HEADER_OUT);
    

提交回复
热议问题