|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-01-26 06:39 UTC] aharvey@php.net
-Status: Open
+Status: Duplicate
[2011-01-26 06:39 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 22:00:02 2025 UTC |
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