ID: 10211
User Update by: [EMAIL PROTECTED]
Status: Closed
Bug Type: cURL related
Description: CURLOPT_HTTPHEADER does not work

I downloaded the 4.0.5RC1 binary from, but it doesn't work 
either.  Although, it looks like the values for CURLOPT_HTTPHEADER and CURLOPT_HEADER 
are now correct.

Then I went to and grabbed the source 4.0.6 (I think it is), 
which compiled ok.  Then I grabbed cURL from, but I'm unable to 
get that to compile to a DLL (despite several attempts). Any suggestions would be 
thanks for your quick response.

Previous Comments:

[2001-04-06 11:35:57] [EMAIL PROTECTED]
Or as you have windows, try latest build from



[2001-04-06 11:35:26] [EMAIL PROTECTED]
This should be fixed in CVS. Please try the latest snapshot



[2001-04-06 11:31:14] [EMAIL PROTECTED]
Also, noticed that CURLOPT_HTTPHEADER and CURLOPT_HEADER have the same value.
Using curl -H "UID: spud" http://... works properly.
Except for CURLOPT_HTTPHEADER and chopping off 2 bytes at the end of a 
CURLOPT_RETURNTRANSFER ... everything works great.
Here's my script:
$url = "http://localhost/perl-bin/";
$user_agent = "VanillaZilla/2001";

$ch = curl_init();
curl_setopt ($ch, CURLOPT_HTTPHEADER, "UID: spud");
curl_setopt ($ch, 23, "UID: spud");
echo "curl_errno=". curl_errno($ch) ."<br>";
echo "curl_error=". curl_error($ch) ."<br>";
curl_setopt ($ch, CURLOPT_VERBOSE, 1);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_COOKIE, "spud=tater;tater=spud"); 
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "pass=spud&data=stuff&case=en");
$result = curl_exec ($ch);
echo "after curl_exec:<br>";
echo "curl_errno=". curl_errno($ch) ."<br>";
echo "curl_error=". curl_error($ch) ."<br>";
curl_close ($ch);

print "<hr><pre>";
echo $result . "<br>";
print "</pre>";


Full Bug description available at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to