PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Request » Bug #5981

HTTP_Client hangs on POST requests

Details

Submitted2005-11-16 11:32 UTC
Frominfo at e-novative dot de
StatusNo Feedback
PackageHTTP_Request
PHP Version5.0.5
OSWin XP
Roadmaps(Not assigned)

Comments

[2005-11-16 11:32 UTC] info at e-novative dot de

Description:
------------
HTTP_Client hangs on POST requests. Sending a GET request to the same URL works fine. The example below works fine if you comment out the post request, if you leave it in, the script never terminates. From the apache log I can tell that the POST request is actually being sent, and it seems that there is a problem when reading the response. I tried to track it down without success.

A similar problem is described in Bug #4835, but the test script provided there works fine for me.

Probably the problem itself is not in HTTP_Client, but I am not sure where to start otherwise.

Test script:
---------------
require 'HTTP/Client.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);

$client = new HTTP_Client();
$client->get('http://localhost/target.php');
var_dump($client);

$client->post('http://localhost/target.php', array());
var_dump($client);

Expected result:
----------------
dump of $client object twice.

Actual result:
--------------
Does not terminate.

[2005-11-27 13:57 UTC] info at e-novative dot de

The result is:

POST /target.php HTTP/1.1 Host: localhost User-Agent: PEAR HTTP_Request class ( http://pear.php.net/ ) Connection: close Accept-Encoding: gzip Content-Type: application/x-www-form-urlencoded