PHP 4.0 Bug #10211 Updated: CURLOPT_HTTPHEADER does not work
| From: | cleesmith at hotmail dot com | Date: | Sat, 21 Apr 2001 22:37:03 +0000 |
| Subject: | PHP 4.0 Bug #10211 Updated: CURLOPT_HTTPHEADER does not work | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-52115@lists.php.net to get a copy of this message | ||
ID: 10211
User Update by: cleesmith@hotmail.com
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] cleesmith@hotmail.com
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] cleesmith@hotmail.com
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] sniper@php.net
Or as you have windows, try latest build from http://www.php4win.de/
--Jani
---------------------------------------------------------------------------
[2001-04-06 11:35:26] sniper@php.net
This should be fixed in CVS. Please try the latest snapshot
from http://snaps.php.net/
--Jani
---------------------------------------------------------------------------
[2001-04-06 11:31:14] cleesmith@hotmail.com
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 cleesmith@hotmail.com
---------------------------------------------------------------------------
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