How to solve the error of '302' moved temporary.

There is answer for this is
Immediately after receiving this status code, the client should use the new URL to resolve the request, but the old URL should be used for all future requests.

i write such code
($res->code() eq '302'){

$newurl = $res->headers->header('location');
#Create the HTTP request object
my $new_req = new HTTP::Request GET =>$newurl;
my $new_res = $ua->request($new_req);
#print $new_res->as_string();

}

but it is showing the same error like
HTTP/1.1 302(found) moved temporary
Connection:close
Date:
Location:
.
.

such headers...

thanks.

    Hi,

    this looks like Perl code ...

    Looks like you're never printing the new URL since this code

    #print $new_res->as_string();

    is commented out.

    Thomas

      ya it is Perl code..
      but there might be logic same for every language...

      no forum is as fast as yours..so i posted here.

      I am stuck in the error 302..
      print #$res->as_string();
      it returns the code of the URL.

      here the ouput is coming ........

      HTTP/1.1 302 (Found) Moved Temporarily
      Connection: close
      Date: Tue, 15 Feb 2005 12:18:03 GMT
      Via: 1.1 PaceNet (NetCache NetApp/5.5R6)
      Location: http://somesite.com/talent/index.jsp
      Server: Apache/1.3.33 (Unix) mod_perl/1.29
      Content-Type: text/html
      Client-Date: Tue, 15 Feb 2005 12:22:07 GMT
      Client-Peer: 65.198.151.212:80
      Client-Response-Num: 1
      P3P: CP="ALL ADMi DEVi PSA CONi OUR DELi SAMi BUS NAV COM CNT ONL INT PHY DEM UNI"
      Set-Cookie: JSESSIONID=CRpmBL7Z7hzyzCwCqcCyQx9fHp2cJKryyBkf7SWhsRGPzrTG1X1T!-637755235!NONE; path=/

      There is solution like..
      302 Moved Temporarily

      The requested URL has moved, but only temporarily. The Location header points to the new location. Immediately after receiving this status code, the client should use the new URL to resolve the request, but the old URL should be used for all future requests.

      but i didn't get how to write code...
      something i am missing there ....to send the HTTP request...

      plz,if u are known help me..

      thanks,
      sandhya.

        Write a Reply...