Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在发送一个 cURL 请求并仅使用 URL 填充它。发送到服务器的标头由 cURL 填充,我猜这些标头何时填充,我猜,当我打电话时curl_exec?
curl_exec
我很感兴趣如何在填充这些标题后获取这些标题,尤其是Host值。我知道CURLINFO_EFFECTIVE_URL,尽管这与Host.
Host
CURLINFO_EFFECTIVE_URL
它们在初始化时设置为默认值,您可以通过设置来查看标头curl_setopt($ch, CURLOPT_VERBOSE, TRUE);它将吐出请求标头(以'>'为前缀的行)
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);