php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #52201 Missing: getting request headers; certinfo
Submitted: 2010-06-29 09:27 UTC Modified: 2010-10-23 16:56 UTC
From: uramihsayibok at gmail dot com Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.2 OS: Windows
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: uramihsayibok at gmail dot com
New email:
PHP Version: OS:

 

 [2010-06-29 09:27 UTC] 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: */*
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-29 09:34 UTC] uramihsayibok at gmail dot com
Oh, and

4. (http://php.net/function.curl-getinfo#80457)
No mention of CURLINFO_REDIRECT_COUNT.
 [2010-10-22 15:47 UTC] kalle@php.net
-Package: cURL related +Package: Documentation problem
 [2010-10-23 16:56 UTC] 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-10-23 16:56 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2010-10-23 16:56 UTC] kalle@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.


 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=13211605159a8a3ba09adc4f990ab69677dc40ed
Log: Fixed bug #52201 (Missing: getting request headers; certinfo)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 24 07:01:35 2024 UTC