php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53843 the post data didn't show when using curl_getinfo($ch, CURLINFO_HEADER_OUT);
Submitted: 2011-01-26 05:00 UTC Modified: 2011-01-26 06:39 UTC
From: elementgi at qq dot com Assigned:
Status: Duplicate Package: cURL related
PHP Version: 5.2.17 OS: WinXP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: elementgi at qq dot com
New email:
PHP Version: OS:

 

 [2011-01-26 05:00 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-26 06:39 UTC] aharvey@php.net
-Status: Open +Status: Duplicate
 [2011-01-26 06:39 UTC] aharvey@php.net
Dupe of bug #53842.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 04:01:29 2025 UTC