Curl, follow location but only get header of the new location?

前端 未结 7 1658
情书的邮戳
情书的邮戳 2020-12-19 13:56

I know that when I set CURLOPT_FOLLOWLOCATION to true, cURL will follow the Location header and redirect to new page. But is it possible only to get header of the new page w

7条回答
  •  半阙折子戏
    2020-12-19 14:57

    Make sure you set CURLOPT_HEADER to True to get the headers in the response, otherwise the response returned as blank string

提交回复
热议问题