On Thu, 13 Mar 2003, lyle hayhurst wrote: > Hello! I am using LWP to post to a web page. The > post works fine, but the $response the comes back > contains the HTML of _another_ page that I have to > POST to. > > This is where I get stuck. > > Normally when I $agent->request( POST $url [...] ) I > know the $url. In this case I don't have a url -- I > have a $response with some html inside of it. How do > I POST to this new page? (I tried using HTML::Form as > well, using the HTML::Form->parse( $content, $uri ) > mechanism, but this simply posted to the original page > I POST'ed to). [...]
I'm sure LWP will do this redirect for you if you ask it right, but: a) IIRC all POSTs are redirected as GET, not POST. b) To get the url, look in the Location header (unless this redirect is done with a Refresh header (which may be in a META HTTP-EQUIV tag in the HTML, but IIRC LWP will add it to the headers automatically). John
