Re: HTTP_Request not following redirects
| From: | Alexey Borzov | Date: | Sun, 03 Dec 2006 17:58:54 +0000 |
| Subject: | Re: HTTP_Request not following redirects | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25963@lists.php.net to get a copy of this message | ||
Hi,
diro@nixsys.bz wrote:
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?Redirect support in HTTP_Request is switched off by default for a reason. That reason being that it wasn't touched for quite a bit of time and is deprecated.