|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-02-08 16:26 UTC] torben@php.net
[2002-02-08 16:42 UTC] robert at gonkgonk dot com
[2002-02-08 17:01 UTC] torben@php.net
[2002-02-08 17:08 UTC] torben@php.net
[2002-02-08 20:54 UTC] robert at gonkgonk dot com
[2002-02-08 21:00 UTC] torben@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
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