Bug #53843 [Opn->Dup]: the post data didn't show when using curl_getinfo($ch, CURLINFO_HEADER_OUT);
| From: | aharvey@php.net | Date: | Wed, 26 Jan 2011 05:39:44 +0000 |
| Subject: | Bug #53843 [Opn->Dup]: the post data didn't show when using curl_getinfo($ch, CURLINFO_HEADER_OUT); | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158189@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53843&edit=1
ID: 53843
Updated by: aharvey@php.net
Reported by: elementgi at qq dot com
Summary: the post data didn't show when using
curl_getinfo($ch, CURLINFO_HEADER_OUT);
-Status: Open
+Status: Duplicate
Type: Bug
Package: cURL related
Operating System: WinXP
PHP Version: 5.2.17
Block user comment: N
Private report: N
New Comment:
Dupe of bug #53842.
Previous Comments:
------------------------------------------------------------------------
[2011-01-26 05:00:52] elementgi at qq dot com
Description:
------------
when i checking out the cURL header using CURLINFO_HEADER_OUT, the post
data didn't show in the body.
Test script:
---------------
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL,
'http://www.google.com.hk/webhp?hl=zh-CN&sourceid=cnhp'
);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLINFO_HEADER_OUT, true );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS,
http_build_query(array('a'=>'1','b'=>'2')));
$response = curl_exec( $ch );
var_dump( curl_getinfo( $ch, CURLINFO_HEADER_OUT ) );
curl_close( $ch );
unset( $ch );
Expected result:
----------------
POST /webhp?hl=zh-CN&sourceid=cnhp HTTP/1.1
Host: www.google.com.hk
Accept: */*
Content-Length: 7
Content-Type: application/x-www-form-urlencoded
a=1&b=2 // <- missing this
Actual result:
--------------
POST /webhp?hl=zh-CN&sourceid=cnhp HTTP/1.1
Host: www.google.com.hk
Accept: */*
Content-Length: 7
Content-Type: application/x-www-form-urlencoded
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53843&edit=1