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

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

WBOY
Release: 2016-06-06 20:49:43
Original
1761 people have browsed it

代码如下

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

抛出错误:

Failed writing header

请问这是怎么回事?

回复内容:

代码如下

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

抛出错误:

Failed writing header

请问这是怎么回事?

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template