PHP cURL 自定义标头 [英] PHP cURL custom headers
本文介绍了PHP cURL 自定义标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道是否/如何将自定义标头添加到 PHP 中的 cURL HTTP 请求.我正在尝试模拟 iTunes 如何抓取艺术品并使用这些非标准标题:
I'm wondering if/how you can add custom headers to a cURL HTTP request in PHP. I'm trying to emulate how iTunes grabs artwork and it uses these non-standard headers:
X-Apple-Tz: 0
X-Apple-Store-Front: 143444,12
如何将这些标头添加到请求中?
How could I add these headers to a request?
推荐答案
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'X-Apple-Tz: 0',
'X-Apple-Store-Front: 143444,12'
));
http://www.php.net/manual/en/function.curl-setopt.php
这篇关于PHP cURL 自定义标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文