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

I have given up on this one, and will just use fsockopen instead ... or switch to Java 
:-)
Sorry about the double posting.
thanks again.

Previous Comments:
---------------------------------------------------------------------------

[2001-04-08 18:04:07] [EMAIL PROTECTED]
I downloaded the 4.0.5RC1 binary from http://www.php4win.de/, 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 http://snaps.php.net/ and grabbed the source 4.0.6 (I think it is), 
which compiled ok.  Then I grabbed cURL from http://curl.haxx.se/, but I'm unable to 
get that to compile to a DLL (despite several attempts). Any suggestions would be 
appreciated.
thanks for your quick response.
chris

---------------------------------------------------------------------------

[2001-04-08 18:03:08] [EMAIL PROTECTED]
I downloaded the 4.0.5RC1 binary from http://www.php4win.de/, 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 http://snaps.php.net/ and grabbed the source 4.0.6 (I think it is), 
which compiled ok.  Then I grabbed cURL from http://curl.haxx.se/, but I'm unable to 
get that to compile to a DLL (despite several attempts). Any suggestions would be 
appreciated.
thanks for your quick response.
chris

---------------------------------------------------------------------------

[2001-04-06 11:35:57] [EMAIL PROTECTED]
Or as you have windows, try latest build from http://www.php4win.de/

--Jani


---------------------------------------------------------------------------

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

--Jani


---------------------------------------------------------------------------

[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:
<?php
$url = "http://localhost/perl-bin/mod_perl_test.pl";
$user_agent = "VanillaZilla/2001";

$ch = curl_init();
curl_setopt ($ch, CURLOPT_HTTPHEADER, "UID: spud");
curl_setopt ($ch, 23, "UID: spud");
echo "after CURLOPT_HTTPHEADER(".CURLOPT_HTTPHEADER." 
CURLOPT_HEADER=".CURLOPT_HEADER."):<br>";
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>";
?>
thanks.
chris  [EMAIL PROTECTED]

---------------------------------------------------------------------------

The remainder of the comments for this report are too long.  To view the rest of the 
comments, please view the bug report online.

Full Bug description available at: http://bugs.php.net/?id=10211


-- 
PHP Development Mailing List <http://www.php.net/>
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