Redirections using LWP

Redirections using LWP

am 03.10.2006 15:32:01 von anand.ksingh

------=_NextPart_000_0091_01C6E71E.69465550
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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?

PS:- The site that I am sending the request is a "https" site.

~Thanks
Anand

http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
____________________________________________________________ _________

This e-mail message may contain proprietary, confidential or legally
privileged information for the sole use of the person or entity to
whom this message was originally addressed. Any review, e-transmission
dissemination or other use of or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is prohibited. If you have received this e-mail in error
kindly delete this e-mail from your records. If it appears that this
mail has been forwarded to you without proper authority, please notify
us immediately at netadmin@patni.com and delete this mail.
____________________________________________________________ _________

------=_NextPart_000_0091_01C6E71E.69465550--

Re: Redirections using LWP

am 03.10.2006 17:49:45 von mumia.w.18.spam+nospam

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