我想知道是否/如何在 PHP 中向 cURL HTTP 请求添加自定义 header 。我正在尝试模拟 iTunes 如何抓取艺术品并使用这些非标准标题:
X-Apple-Tz: 0
X-Apple-Store-Front: 143444,12
如何将这些 header 添加到请求中?
最佳答案
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'X-Apple-Tz: 0',
'X-Apple-Store-Front: 143444,12'
));
关于PHP cURL 自定义 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8115683/