note 80099 deleted from function.curl-setopt by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 17:24:24 +0000 |
| Subject: | note 80099 deleted from function.curl-setopt by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154977@lists.php.net to get a copy of this message | ||
Note Submitter: meat_popsiclez at hotmail dot com
----
Despite the documentation for CURLOPT_HTTPHEADER, all header fields MUST be in one string, with a
eol indicator, inside a single element array, in my experience.
For example, this will fail.
<?php
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Range: Bytes=0-50"));
?>
This will work.
<?php
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Range: Bytes=0-50\n"));
?>
This will only set the first header
<?php
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Range: Bytes=0-50\n","Otherheader:
stuff\n"));
?>
This however, will set both headers as we want.
<?php
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Range: Bytes=0-50\nOtherheader: stuff\n"));
?>