阻止Wordpress向传出请求添加标头

时间:2016-04-19 08:50:50

标签: php wordpress http-headers

我正在制作Wordpress插件,向某些第三方API发出HTTP请求。在Wordpress之外,这可以正常工作,但是当在我的Wordpress服务器上使用它时,似乎是添加了许多标题,以便我现在有重复的标题,并且请求失败。

任何人都可以帮我阻止Wordpress添加重复的Content-Type和Content-Length标题吗?

Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
Content-Length: 20
Content-Length: 20
Content-Type: application/x-www-form-urlencoded

1 个答案:

答案 0 :(得分:0)

我通过在进行调用的脚本中执行硬过滤来修复此问题,确保所有标头只在CURL标头数组中一次。

相关问题