Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2018-08-21 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (197 votes). Check out past polls.

    Notices?