PHP cURL: Get target of redirect, without following it

前端 未结 5 1316
梦毁少年i
梦毁少年i 2021-01-02 10:47

The curl_getinfo function returns a lot of metadata about the result of an HTTP request. However, for some reason it doesn\'t include the bit of information I want at the m

5条回答
  •  Happy的楠姐
    2021-01-02 11:07

    No there is no more efficient way
    Your can use CURLOPT_WRITEHEADER + VariableStream
    So.. you could write headers to variable and parse it

提交回复
热议问题