printing the redirections responses

printing the redirections responses

am 21.07.2005 08:19:07 von orasnita

Hi,

I have tried:

use LWP::UserAgent;

my $url = "https://www.server.com/";

my $ua = LWP::UserAgent->new(env_proxy => 0,
timeout => 200,
keep_alive => 1,
);

my $request = HTTP::Request->new('GET', $url);

my $response = $ua->request($request);

print $response->as_string();

---

The response is the final page, even though there is a redirection until
this page is returned. Is it possible to get and print that redirect HTTP
header?

Thank you.

Teddy

Re: printing the redirections responses

am 21.07.2005 14:53:20 von gisle

"Octavian Rasnita" writes:

> my $response = $ua->request($request);
> print $response->as_string();

[...]

> The response is the final page, even though there is a redirection until
> this page is returned. Is it possible to get and print that redirect HTTP
> header?

Just use $ua->simple_request() instead of $ua->request() to dispatch
the request.

--Gisle