http://qs321.pair.com?node_id=127144

kbeen has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have been cracking my head against a wall trying to get the URL that a user is supposed to be redirectted to after submiting data.
After the data is submited the next page should contain a redirect, as the site administrator assured me that the asp code is this:

Response.Redirect("display.asp?qid=XXXXXX")

I read that the default for following redirects from a POST query is off, and I have tried it with both POST and GET. However, I don't want the script to actually follow the redirect, just get that precious "qid" value for me.

Using the code below, I can't find the redirect in the header or in the content. Does anybody know what is going on, and how my browser can be redirected, but there is actually information sent that tells it where to redirect to? Is there someway that I am not seeing every last byte of response using below?

my $hdrs = new HTTP::Headers('Cookie' => $cookie); my $linkinfo = qw(http://www.nottherealsite.com/login.asp?ui=kbeen&pw= +pass); my $ncontent = new HTTP::Request('POST', $linkinfo, $hdrs); my $resp = $ua->request($content); my $body = $resp->content; my $string = $resp->as_string(); print $string; # no redirect in here print $body; #none here either
Any advice is appreciated.
Thanks
Kbeen