HTTP_Request not following redirects
| From: | diro at nixsys dot bz | Date: | Fri, 01 Dec 2006 23:52:05 +0000 |
| Subject: | HTTP_Request not following redirects | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-25957@lists.php.net to get a copy of this message | ||
Hello,
Here's the sample code:
<?php
include ('HTTP/Request.php');
$req = &new HTTP_Request('http://www.$SITE.com/cgistuff.cgi',
array('allowRedirects'=>true));
$req->setMethod(HTTP_REQUEST_METHOD_POST);
$req->addPostData('var1', 'arg1');
$req->addPostData('var2', 'arg2');
$req->addPostData('var3', 'arg3');
$req->sendRequest();$response1 = $req->getResponseBody();
echo $response1;
?>
Now, i know it's POSTing correctly, because of the address returned in the
headers. I can see via getResponseCode that it's 302, obviously not redirecting
for some reason.
Any ideas? Need more info?
TIA