in reply to What is the best way to get the response payload

Arn't HTTP headers terminated with a double new line?

 my ($header,$content) = split(/\n\n/,$response->as_string());

I'm no expert with split but that should be sufficient :)

___________
Eric Hodges

Replies are listed 'Best First'.
Re: Re: What is the best way to get the response payload
by MarkM (Curate) on Sep 10, 2003 at 02:20 UTC

    Of course, I'm sure you intended:

    my($header, $content) = split(/\n\n/, $response->as_string, 2);

    (Otherwise, if the body contained any blank lines, the blank lines would be lost...)

    I prefer the solution posted by somebody else: $response->content.