HTTP::Handle - HTTP Class designed for streaming
use HTTP::Handle; my $http = HTTP::Handle->new( uri => "http://www.google.com/" ); $http->connect(); my $fd = $http->fd(); while (<$fd>) { print "--> $_"; }
Version: 0.2
$Id: Handle.pm,v 1.6 2004/07/03 08:44:53 psionic Exp $
The HTTP::Handle module allows you to make HTTP requests and handle the data yourself. The general ideas is that you use this module to make a HTTP request and handle non-header data yourself. I needed such a feature for my mp3 player to listen to icecast streams.
HTTP::Handle
Create a new HTTP::Handle object thingy.
Arguments possible:
Sets the initial URL to connect to.
Automatically follow HTTP redirects. This defaults to true (1). Set to 0 to disable this.
Any thing put in here will be sent as "key: value" in the http request string.
Connect, send the http request, and process the response headers.
This function returns -1 on failure, undef otherwise. The reason for failure will be printed to STDERR.
Get the file descriptor (socket) we're using to connect.
Get or set the URL. If a url string is passed, you will change the url that is requested. If no parameter is passed, a URI object will be returned containing the
If a value is passed then you will set whether or not we will automatically follow HTTP 302 Redirects. If no value is passed, then we will return whatever the current option is.
Defaults to 1 (will follow redirects).
Returns a string containing the HTTP request and headers, this is used when $http->connect() is called.
Jordan Sissel <psionic@csh.rit.edu>
To install HTTP::Handle, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::Handle
CPAN shell
perl -MCPAN -e shell install HTTP::Handle
For more information on module installation, please visit the detailed CPAN module installation guide.