note 26797 modified in function.curl-setopt by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 17:35:00 +0000 |
| Subject: | note 26797 modified in function.curl-setopt by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155002@lists.php.net to get a copy of this message | ||
About the CURLOPT_HTTPHEADER option, it took me some time to figure out how to format the so-called
'Array'. It fact, it is a list of strings. If Curl was already defining a header item,
yours will replace it. Here is an example to change the Content Type in a POST:
<?php curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml")); ?>
Yann
--was--
About the CURLOPT_HTTPHEADER option, it took me some time to figure out how to format the so-called
'Array'. It fact, it is a list of strings. If Curl was already defining a header item,
yours will replace it. Here is an example to change the Content Type in a POST:
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
Yann
http://php.net/manual/en/function.curl-setopt.php