#50459 [Opn->Csd]: CURLINFO_HEADER_OUT does not work
| From: | bjori@php.net | Date: | Wed, 06 Jan 2010 08:31:19 +0000 |
| Subject: | #50459 [Opn->Csd]: CURLINFO_HEADER_OUT does not work | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3628@lists.php.net to get a copy of this message | ||
ID: 50459
Updated by: bjori@php.net
Reported By: tony at marston-home dot demon dot co dot uk
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Windows XP
PHP Version: 5.3.1
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2010-01-06 08:30:48] svn@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&revision=293172
Log: Fixed bug#50459 (CURLINFO_HEADER_OUT does not work), patch by Dave
Tajchreber/yawk
------------------------------------------------------------------------
[2009-12-12 16:20:34] felipe@php.net
Read this user note:
http://docs.php.net/manual/en/function.curl-getinfo.php#83898
"[...] if you want to use curl_getinfo() with option
CURLINFO_HEADER_OUT in order to debug your cURL request, you must add
curl_setopt($handle, CURLINFO_HEADER_OUT, true); [...]"
Changed category to "Documentation problem", as this constant also
isn't mentioned in the curl_setopt() doc page.
------------------------------------------------------------------------
[2009-12-12 15:38:49] tony at marston-home dot demon dot co dot uk
Description:
------------
The following line always returns FALSE:
$info = curl_getinfo($ch, CURLINFO_HEADER_OUT);
Reproduce code:
---------------
$request = <<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>menu.getAnswer</methodName>
<params/>
</methodCall>
EOD;
$header[] = "Content-type: text/xml";
$header[] = "User-Agent: foobar";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($ch);
$info = curl_getinfo($ch, CURLINFO_HEADER_OUT);
Expected result:
----------------
According to the documentation this option has been available since
version 5.1.3, so I expect to see the request headers which were sent
out.
Actual result:
--------------
The result is always FALSE.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50459&edit=1