Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/239.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 阻止Wordpress向传出请求添加标题_Php_Wordpress_Http Headers - Fatal编程技术网

Php 阻止Wordpress向传出请求添加标题

Php 阻止Wordpress向传出请求添加标题,php,wordpress,http-headers,Php,Wordpress,Http Headers,我正在制作一个Wordpress插件,它可以向第三方API发出HTTP请求。在Wordpress之外,这很好,但是当在我的Wordpress服务器上使用它时,它似乎添加了许多头,因此我现在有了重复的头,请求失败 有人能帮我阻止Wordpress添加重复的内容类型和内容长度标题吗 Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) Ap

我正在制作一个Wordpress插件,它可以向第三方API发出HTTP请求。在Wordpress之外,这很好,但是当在我的Wordpress服务器上使用它时,它似乎添加了许多头,因此我现在有了重复的头,请求失败

有人能帮我阻止Wordpress添加重复的内容类型和内容长度标题吗

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

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

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