Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by jdporter (Paladin)
on Mar 31, 2003 at 15:06 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://246943]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-19 12:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found