redirection content
am 07.07.2006 23:03:38 von list_usrHi,
how could I get the content of each http response in a series of
redirected pages? It seems to me that the only content available from
HTTP::Response as_string is the content from the first response.
I've been told (and it would make sense) that the content would be from
the final response, but from what I'm seeing that doesn't seem to be the
case.
For anyone familiar with webinject (http://www.webinject.org), what I'm
doing is testing a certain URL for the response code 200. The URL I
provide initially responds with 302 but my test comes back positive. The
URL that responds with a 302 provides a location that responds with a 200.
However, in the http logfile, I'm only seeing content from the initial
URL (which responds with a 302.)
So, what I'm wondering is why I'm seeing content from the original
response, but getting a response code from the final response.
What I'm expecting is $response->code and $response->as_string both
contain the data from the final response. Is this the case? If so, I'll
have too look at webinject's code and the response data a little more
carefully.
Also, what does $response->previous return? Another HTTP::Response
object? If there were 5 levels of redirection, would five calls to
$response->previous get me all the data from each response?
Thank you.