in reply to How to reconstruct HTTP::Response from file properly
The fault does not seem to be on my part, because this module gets the split between header-data and (possibly gzipped)-content-data right every time! If I were on cpan, I would file a bug report for the otherwise rock-solid libwww-perl modules.use HTTP::Parser; my $parser = HTTP::Parser->new(response => 1); my $status = $parser->add( $stored_as_file ); my $restored_response = $parser->object();
and so far it works... (any comments?)my ( $HTTP_Version, $Status_Code, $Reason_Phrase ) = HTTP::MessagePars +er->parse_response_line( $stored_as_file ); my ( $Method, $Request_URI, $HTTP_Version, $Headers, $Body ) = HTTP::M +essageParser->parse_response( $stored_as_file ); my $restored_response= HTTP::Response->new( $Status_Code, $Reason_Phra +se, $Headers, ${$Body} );
|
|---|