From:
Operating system: WinXP
PHP version: 5.2.17
Package: cURL related
Bug Type: Bug
Bug description:the post data didn't show when using curl_getinfo($ch,
CURLINFO_HEADER_OUT);
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 bug report at http://bugs.php.net/bug.php?id=53843&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53843&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53843&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53843&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53843&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53843&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53843&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53843&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53843&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53843&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53843&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53843&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53843&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53843&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53843&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53843&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53843&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53843&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53843&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53843&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53843&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53843&r=mysqlcfg