NAME

WWW::CurlOO::Easy - Perl interface for curl_easy_* functions

WARNING

THIS MODULE IS UNDER HEAVY DEVELOPEMENT AND SOME INTERFACE MAY CHANGE YET.

SYNOPSIS

use WWW::CurlOO::Easy qw(:constants);

my $easy = WWW::CurlOO::Easy->new();
$easy->setopt( CURLOPT_URL, "http://example.com/" );

$easy->perform();

DESCRIPTION

This module wraps easy handle from libcurl and all related functions and constants. It does not export by default anything, but constants can be exported upon request.

use WWW::CurlOO::Easy qw(:constants);

METHODS

CLASS->new( [BASE] )

Creates new WWW::CurlOO::Easy object. If BASE is specified it will be used as object base, otherwise an empty hash will be used. BASE must be a valid reference which has not been blessed already. It will not be used by the object.

Calls curl_easy_init(3) and presets some defaults.

OBJECT->duphandle( [BASE] )

Clone WWW::CurlOO::Easy object. It will not copy BASE from the source object. If you want it copied you must do it on your own.

use WWW::CurlOO::Easy;
use Storable qw(dclone);

my $shallow_clone = $easy->duphandle( { %$easy } );
my $deep_clone = $easy->duphandle( dclone( $easy ) );

Calls curl_easy_duphandle(3).

OBJECT->setopt( OPTION, VALUE )

Set an option. OPTION is a numeric value, use one of CURLOPT_* constants. VALUE depends on whatever that option expects.

Calls curl_easy_setopt(3).

OBJECT->pushopt( OPTION, ARRAY )

If option expects a slist, specified array will be appended instead of replacing the old slist.

Calls curl_easy_setopt(3).

OBJECT->perform( )

Perform upload and download process.

Calls curl_easy_perform(3).

OBJECT->getinfo( OPTION )

Retrieve a value. OPTION is one of CURLINFO_* constants.

Calls curl_easy_getinfo(3).

OBJECT->error( )

Get last error message.

See information on CURLOPT_ERRORBUFFER in curl_easy_setopt(3) for a longer description.

OBJECT->send( BUFFER )

Send raw data.

Calls curl_easy_send(3). Not available in curl before 7.18.2.

OBJECT->recv( BUFFER, MAXLENGTH )

Receive raw data.

Calls curl_easy_recv(3). Not available in curl before 7.18.2.

OBJECT->DESTROY( )

Cleans up. It should not be called manually.

Calls curl_easy_cleanup(3).

FUNCTIONS

strerror( [WHATEVER], CODE )

Return a string for error code CODE.

Calls curl_easy_strerror(3).

SEE ALSO

WWW::CurlOO WWW::CurlOO::Multi

COPYRIGHT

Copyright (c) 2011 Przemyslaw Iskra <sparky at pld-linux.org>.

You may opt to use, copy, modify, merge, publish, distribute and/or sell copies of the Software, and permit persons to whom the Software is furnished to do so, under the terms of the MPL or the MIT/X-derivate licenses. You may pick one of these licenses.