php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #50459 CURLINFO_HEADER_OUT does not work
Submitted: 2009-12-12 15:38 UTC Modified: 2010-01-06 08:31 UTC
From: tony at marston-home dot demon dot co dot uk Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.3.1 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tony at marston-home dot demon dot co dot uk
New email:
PHP Version: OS:

 

 [2009-12-12 15:38 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-12 16:20 UTC] 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.
 [2010-01-06 08:30 UTC] 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
 [2010-01-06 08:31 UTC] bjori@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 24 03:01:33 2024 UTC