note 80099 added to function.curl-setopt

From: Date: Sat, 29 Dec 2007 05:13:13 +0000
Subject: note 80099 added to function.curl-setopt
Groups: php.notes 
Request: Send a blank email to php-notes+get-134094@lists.php.net to get a copy of this message
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")); ?> ---- Server IP: 87.238.162.147 Probable Submitter: 24.76.5.104 ---- Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php Edit -- https://master.php.net/note/edit/80099 Del: integrated -- https://master.php.net/note/delete/80099/integrated Del: useless -- https://master.php.net/note/delete/80099/useless Del: bad code -- https://master.php.net/note/delete/80099/bad+code Del: spam -- https://master.php.net/note/delete/80099/spam Del: non-english -- https://master.php.net/note/delete/80099/non-english Del: in docs -- https://master.php.net/note/delete/80099/in+docs Del: other reasons-- https://master.php.net/note/delete/80099 Reject -- https://master.php.net/note/reject/80099 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#134094) next »