Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

In reply to Finding a redirect's URL by kbeen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found