From: [EMAIL PROTECTED]
Operating system: Linux
PHP version: 4.1.1
PHP Bug Type: cURL related
Bug description: RETURNTRANSFER and CUSTOMREQUST do not play well together
When using curl to request a page, if I just set RETURNTRANSFER curlopt,
things work as expected (output is dumped into a variable). If I just set
CUSTOMREQUEST, thinks work as expected (output is dumped to stdout).
However, if I set RETURNTRANSFER and CUSTOMREQUEST at the same time, I get
no output. The request is made, according to my apache logs, but I get
nothing. Here is some demo code:
<?
$c = curl_init();
$request = '';
$request .= 'GET /testfiles/phptest.php' . "\r\n";
curl_setopt($c, CURLOPT_URL,
'http://localhost:8080/testfiles/phptest.php');
curl_setopt($c, CURLOPT_CUSTOMREQUEST, $request);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo trim( curl_exec($c) );
curl_close($c);
?>
That is an example of a request that will not work. Comment either one of
the "curl_setopt" lines out and it will.
Thanks,
robert
--
Edit bug report at: http://bugs.php.net/?id=15279&edit=1
--
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]