Home >Backend Development >PHP Tutorial >curl提示“Failed writing header”,什么叫“没有写标题!” (≖ ‿ ≖)✧ 噗~

curl提示“Failed writing header”,什么叫“没有写标题!” (≖ ‿ ≖)✧ 噗~

WBOY
WBOYOriginal
2016-06-06 20:49:431750browse

代码如下

<code>$curl = curl_init (); // 启动一个CURL会话
curl_setopt ( $curl, CURLOPT_URL, $url );
curl_setopt ( $curl, CURLOPT_HEADERFUNCTION, function($ch, $str){} );
</code>

抛出错误:

Failed writing header

请问这是怎么回事?

回复内容:

代码如下

<code>$curl = curl_init (); // 启动一个CURL会话
curl_setopt ( $curl, CURLOPT_URL, $url );
curl_setopt ( $curl, CURLOPT_HEADERFUNCTION, function($ch, $str){} );
</code>

抛出错误:

Failed writing header

请问这是怎么回事?

我明白了,我设置CURLOPT_HEADER, FALSE,ture就可以了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn