curl-library
[ curl-Bugs-901648 ] RETURNTRANSFER and CUSTOMREQUEST incompatibility
Date: Sat, 21 Feb 2004 00:57:41 -0800
Bugs item #901648, was opened at 2004-02-21 09:57
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=901648&group_id=976
Category: libcurl
Group: bad behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: Matteo Beccati (ciaccia)
Assigned to: Daniel Stenberg (bagder)
Summary: RETURNTRANSFER and CUSTOMREQUEST incompatibility
Initial Comment:
I'm posting this here as suggested on bugs.php.net.
This bugs shows an incompatibility between
CURLOPT_RETURNTRANSFER and
CURLOPT_CUSTOMREQUEST.
For reference: http://bugs.php.net/bug.php?id=27341
Description:
------------
Trying to help a friend which wanted to do a curl HEAD
request with PHP (just like the shell curl -I does), I
wrote down this code, without much checking:
$ch = curl_init('http://foo/bar.html');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD');
var_dump(curl_exec($ch));
In fact he tried it and told me it doesn't work, while this
does:
$ch = curl_init('http://foo/bar.html');
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD');
ob_start();
curl_exec($ch);
var_dump(ob_get_clean());
I tried this both on win32 and ilnux with:
Win32: libcurl/7.10.5 OpenSSL/0.9.7b zlib/1.1.4
Linux: curl 7.10.8 (i686-pc-linux-gnu) libcurl/7.10.8
OpenSSL/0.9.7c zlib/1.2.1
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=901648&group_id=976
Received on 2004-02-21