Http_Request does not works for me
| From: | Marcos Neves | Date: | Thu, 09 Oct 2003 20:02:57 +0000 |
| Subject: | Http_Request does not works for me | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8368@lists.php.net to get a copy of this message | ||
I execute the example.php file that come with Http_Request
and get a Bad Request answer from any server that I try.
Here's the code:
include('HTTP/Request.php');
$req = &new HTTP_Request('http://www.php.net');
$req->setMethod(HTTP_REQUEST_METHOD_POST);
$req->addPostData('Foo', 'bar');
$req->sendRequest();
$response1 = $req->getResponseBody();
$req->setMethod(HTTP_REQUEST_METHOD_GET);
$req->setURL('http://pear.php.net');
$req->clearPostData();
$req->sendRequest();
$response2 = $req->getResponseBody();
echo $response1;
echo $response2;