Re: Redirections using LWP
"Mumia W." <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.lwp |
|---|---|
| Message-ID | <[email protected]> |
On 10/03/2006 08:32 AM, Anand K Singh wrote: > Hello Folks, > > I am new to LWP and I am trying to get the content of a page by passing some > parameters to the host. But the host returns "301 Moved Temporarily" page. > Can somebody help me to get this going. What methods do I need to call? And > what could be the parameters? > [...] When you get a 3xx response, you also get a Location: header that specifies where the content has moved to, e.g.: Location: http://alternate-site.example.com/directory/foo Usually, LWP takes care of this internally. In exotic situations, you might have to examine the contents of the Location: header yourself. Read the docs for LWP and the response object: perldoc LWP::UserAgent perldoc HTTP::Response