Bug #15279 Updated: RETURNTRANSFER and CUSTOMREQUST do not play well together
| From: | torben@php.net | Date: | Fri, 08 Feb 2002 21:26:29 +0000 |
| Subject: | Bug #15279 Updated: RETURNTRANSFER and CUSTOMREQUST do not play well together | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-79765@lists.php.net to get a copy of this message | ||
ID: 15279
Updated by: torben@php.net
Reported By: robert@gonkgonk.com
-Status: Open
+Status: Feedback
Bug Type: cURL related
Operating System: Linux
PHP Version: 4.1.1
New Comment:
What happens if you try with a valid HTTP request, or just
'GET', as the custom response? The script you gave below
didn't work for me either, but did if I did either of:
$request = "GET /index.html HTTP/1.0\r\n\r\n";
...or...
$request = "GET";
Can you try that and report back?
Torben
Previous Comments:
------------------------------------------------------------------------
[2002-01-29 11:53:52] robert@gonkgonk.com
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 this bug report at http://bugs.php.net/?id=15279&edit=1