The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

HTTP::Handle - HTTP Class designed for streaming

SYNOPSIS

 use HTTP::Handle;

 my $http = HTTP::Handle->new( uri => "http://www.google.com/" );
 $http->connect();
 
 my $fd = $http->fd();
 
 while (<$fd>) {
        print "--> $_";
 }

VERSION

Version: 0.2

$Id: Handle.pm,v 1.6 2004/07/03 08:44:53 psionic Exp $

DESCRIPTION

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->new()

Create a new HTTP::Handle object thingy.

Arguments possible:

url => "http://www.google.com/"

Sets the initial URL to connect to.

follow_redirects => [ 0 | 1 ]

Automatically follow HTTP redirects. This defaults to true (1). Set to 0 to disable this.

http_request => HASHREF

Any thing put in here will be sent as "key: value" in the http request string.

$http->connect()

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.

$http->fd()

Get the file descriptor (socket) we're using to connect.

$http->url( [ url_string ])

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

$http->follow_redirects( [ 0 | 1 ] )

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).

$http->http_request_string()

Returns a string containing the HTTP request and headers, this is used when $http->connect() is called.

AUTHOR

Jordan Sissel <psionic@csh.rit.edu>