Doc #52201 [Opn]: Missing: getting request headers; certinfo
| From: | uramihsayibok at gmail dot com | Date: | Tue, 29 Jun 2010 07:34:44 +0000 |
| Subject: | Doc #52201 [Opn]: Missing: getting request headers; certinfo | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4610@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
User updated by: uramihsayibok at gmail dot com
Reported by: uramihsayibok at gmail dot com
Summary: Missing: getting request headers; certinfo
Status: Open
Type: Documentation Problem
Package: cURL related
Operating System: Windows
PHP Version: 5.3.2
New Comment:
Oh, and
4. (http://php.net/function.curl-getinfo#80457)
No mention of CURLINFO_REDIRECT_COUNT.
Previous Comments:
------------------------------------------------------------------------
[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