in reply to Help With Post-Redirect-Get Problem

You're being redirected

HTTP/1.1 302 Found ... Location: http://www.sanmateocountytaxcollector.org/SMCWPS/Home?goTo=s +ecure ...

but you used simple_request instead of ->request so you're not performing the redirection.

If you switch to ->request, you end up in an infinite redirection loop.

HTTP/1.1 302 Found ... Location: http://www.sanmateocountytaxcollector.org/SMCWPS/pages/secur +eSearch.jsp ... Client-Response-Num: 9 Client-Warning: Redirect loop detected (max_redirect = 7) ...

It's probably cause it's trying to set cookies and they're not being handled.

Set-Cookie: JSESSIONID=0000WK9hTtPjeyIqUyVwqxfrxIQ:-1;Path=/

If so, giving LWP::UserAgent a cookie jar will do the trick. Using WWW::Mechanize would also do the trick.

Replies are listed 'Best First'.
Re^2: Help With Post-Redirect-Get Problem
by brian123 (Novice) on Dec 09, 2010 at 05:34 UTC
    hmmm, what does all this mean? Do I just change the
    $r = $ua->simple_request(GET $u); to $r = $ua->request(GET $u);
    Please provide the code if you would since I am a little new with Perl.
    Thanks.

      That's the first step. After that, you end up in an infinite redirection loop.

      HTTP/1.1 302 Found ... Location: http://www.sanmateocountytaxcollector.org/SMCWPS/pages/secur +eSearch.jsp ... Client-Response-Num: 9 Client-Warning: Redirect loop detected (max_redirect = 7) ...

      It's probably cause it's trying to set cookies and they're not being handled.

      Set-Cookie: JSESSIONID=0000WK9hTtPjeyIqUyVwqxfrxIQ:-1;Path=/

      If so, giving LWP::UserAgent a cookie jar will do the trick. Using WWW::Mechanize would also do the trick.

        ok, thank you.