|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69313 http\Client doesn't send GET body
Submitted: 2015-03-27 00:55 UTC Modified: 2015-03-27 07:40 UTC
From: php at qzxj dot net Assigned: mike (profile)
Status: Closed Package: pecl_http (PECL)
PHP Version: 5.6.7 OS: Ubuntu 14.10 64-bit
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.
Block user comment
Status: Assign to:
Bug Type:
From: php at qzxj dot net
New email:
PHP Version: OS:


 [2015-03-27 00:55 UTC] php at qzxj dot net
pecl_http doesn't work properly when sending a GET request with a body. The server hangs for about 10 seconds once send() is called. It looks like the Content-Length is getting sent but the request body is not, so apache is hanging waiting for the body to be sent but it never comes.

Curl command line works:

    $ curl -X GET localhost/test.php -d 'hello'
    GET application/x-www-form-urlencoded, 3 bytes: foo

But my demo script doesn't:

    $ php demo.php
    GET text/plain, 3 bytes:

Test script:
// http://localhost/test.php
     "{$_SERVER['CONTENT_TYPE']}, {$_SERVER['CONTENT_LENGTH']} bytes: ".

// demo.php
$c = new \http\Client;
$r = new \http\Request(
    'GET', 'http://localhost/test.php',
    (new \http\Message\Body)->append('foo')
$s = microtime(true);
$rs = $c->enqueue($r)->send()->getResponse();
$t = microtime(true) - $s;
echo "Took $t seconds\n";
echo $rs->getBody()."";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-27 07:40 UTC]
-Status: Open +Status: Verified -Assigned To: +Assigned To: mike
 [2015-03-27 09:16 UTC]
Automatic comment on behalf of mike
Log: Fixed bug #69313
 [2015-03-27 09:16 UTC]
-Status: Verified +Status: Closed
 [2015-03-27 09:18 UTC] php at qzxj dot net
Amazing! Thanks for the super-fast turnaround!
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 11:01:30 2024 UTC