Bug #15279: RETURNTRANSFER and CUSTOMREQUST do not play well together
| From: | robert at gonkgonk dot com | Date: | Tue, 29 Jan 2002 16:53:54 +0000 |
| Subject: | Bug #15279: RETURNTRANSFER and CUSTOMREQUST do not play well together | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-78452@lists.php.net to get a copy of this message | ||
From: robert@gonkgonk.com
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