Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: create a HTTP::Response object from a raw buffer?

by jdporter (Canon)
on Mar 31, 2003 at 15:06 UTC ( #246943=note: print w/replies, xml ) Need Help??


in reply to create a HTTP::Response object from a raw buffer?

Sounds to me like you probably want the Net::HTTP::NB module (a non-blocking HTTP client), and especially its read_response_headers method. See the module for example and description, but in a nutshell you can do this:
use Net::HTTP::NB; my $s = Net::HTTP::NB->new( Host => 'www.perlmonks.org' ); $s->write_request( GET => "/" ); my( $code, $msg, %headers ) = $s->read_response_headers;
(However, don't actually do it like that. See the module for a better example.)

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://246943]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2018-05-27 00:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?