note 93686 added to function.curl-setopt
| From: | Chris at PureFormSolutions dot com | Date: | Tue, 22 Sep 2009 22:54:17 +0000 |
| Subject: | note 93686 added to function.curl-setopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160955@lists.php.net to get a copy of this message | ||
I've found that setting CURLOPT_HTTPHEADER more than once will clear out any headers
you've set previously with CURLOPT_HTTPHEADER.
Consider the following:
<?php
# ...
curl_setopt($cURL,CURLOPT_HTTPHEADER,array (
"Content-Type: text/xml; charset=utf-8",
"Expect: 100-continue"
));
# ... do some other stuff ...
curl_setopt($cURL,CURLOPT_HTTPHEADER,array (
"Accept: application/json"
));
# ...
?>
Both the Content-Type and Expect I set will not be in the outgoing headers, but Accept will.
----
Server IP: 64.71.164.2
Probable Submitter: 24.21.86.44
----
Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php
Edit -- https://master.php.net/note/edit/93686
Del: integrated -- https://master.php.net/note/delete/93686/integrated
Del: useless -- https://master.php.net/note/delete/93686/useless
Del: bad code -- https://master.php.net/note/delete/93686/bad+code
Del: spam -- https://master.php.net/note/delete/93686/spam
Del: non-english -- https://master.php.net/note/delete/93686/non-english
Del: in docs -- https://master.php.net/note/delete/93686/in+docs
Del: other reasons-- https://master.php.net/note/delete/93686
Reject -- https://master.php.net/note/reject/93686
Search -- https://master.php.net/manage/user-notes.php