Date:  08 Dec 2014 18:59:34 Hong Kong Time

[PEAR-BUG] Bug #20458 [Opn->Bgs]: HTTP_Request2 POST parameters ignored?

NNTP-Posting-Host:  null

Edit report at

 ID:               20458
 Updated by:
 Reported By:      lennart dot borgman at gmail dot com
 Summary:          HTTP_Request2 POST parameters ignored?
-Status:           Open
+Status:           Bogus
 Type:             Bug
 Package:          HTTP_Request2
 Operating System: Cygwin
 Package Version:  2.2.1
 PHP Version:      5.5.19
 Roadmap Versions: 
 New Comment:

-Status: Open
+Status: Bogus
This is not a bug, thus my answer goes to stackoverflow

Previous Comments:

[2014-12-07 16:13:52] lborgman

I am not sure if this is a bug since I am not totally sure about the 
syntax/semantics for POST.

However when I compare with the result from a call to curl the results 
differ. And it looks like the parameters to POST have been ignored (like

they were null).

The test script below is run against an OpenSearchServer (see, essentially Lucene, i.e. java).

The corresponding curl call looks like this:

curl -XPOST -H "Content-Type: application/json" -d 

I have tried to ask a question about this here:

Test script:
// $data = null;

$r = new HTTP_Request2($url);
$r->setHeader('Content-Type', 'application/json;charset=UTF-8');
$response = $r->send();
$responseStatus = $response->getStatus();
if ($responseStatus < 200 || $responseStatus >= 400) {
        echo "\n\n" . $queryUrl . "\n\n";
        echo "Bad status: " . $responseStatus;
        echo " " . $response->getReasonPhrase();
        echo "\n" . $response->getBody();
$body = $response->getBody();
echo $body;

Expected result:
I expected 11 hits.

Actual result:
I got 2445 hits (which is all records in the OpenSearchServer database).


Edit this bug report at