Doc #52201 [Opn->Csd]: Missing: getting request headers; certinfo
| From: | kalle@php.net | Date: | Sat, 23 Oct 2010 14:56:27 +0000 |
| Subject: | Doc #52201 [Opn->Csd]: Missing: getting request headers; certinfo | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5380@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52201&edit=1
ID: 52201
Updated by: kalle@php.net
Reported by: uramihsayibok at gmail dot com
Summary: Missing: getting request headers; certinfo
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Windows
PHP Version: 5.3.2
-Assigned To:
+Assigned To: kalle
Block user comment: N
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-10-23 16:56:24] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=304664
Log: Fixed bug #52201 (Missing: getting request headers; certinfo)
------------------------------------------------------------------------
[2010-06-29 09:34:44] uramihsayibok at gmail dot com
Oh, and
4. (http://php.net/function.curl-getinfo#80457)
No mention of CURLINFO_REDIRECT_COUNT.
------------------------------------------------------------------------
[2010-06-29 09:27:38] uramihsayibok at gmail dot com
Description:
------------
A couple things missing from the documentation on curl_getinfo:
1. (as mentioned in the comment
http://php.net/function.curl-getinfo#83898)
To be able to use $opt=CURLINFO_HEADER_OUT you have to had curl_setopt'd
CURLINFO_HEADER_OUT=true first.
2. On that subject,
If that option is set then (and only then) the associative array
returned ($opt=0) will include a request_header item.
3. Also regarding that array,
It includes an unmentioned "certinfo" subarray. I'm not sure what this
is for.
Test script:
---------------
$curl = curl_init("https://www.google.com");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // if needed
curl_exec($curl);
print_r(curl_getinfo($curl)); // with certinfo, without request_header
curl_setopt($curl, CURLINFO_HEADER_OUT, true);
curl_exec($curl);
print_r(curl_getinfo($curl)); // with certinfo, with request_header
Expected result:
----------------
Tomorrow's lottery numbers
Actual result:
--------------
Array
(
...
[certinfo] => Array
(
)
)
Array
(
...
[certinfo] => Array
(
)
[request_header] => GET / HTTP/1.1
Host: www.google.com
Accept: */*
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52201&edit=1