package WWW::Curl::Easy;
use strict;
use Carp;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
$VERSION = '3.1';
require WWW::Curl;
require Exporter;
require AutoLoader;
@ISA = qw(Exporter DynaLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
@EXPORT = qw(
@CURLOPT_INCLUDE@
);
$WWW::Curl::Easy::headers = "";
$WWW::Curl::Easy::content = "";
sub AUTOLOAD {
# This AUTOLOAD is used to 'autoload' constants from the constant()
# XS function.
( my $constname = $AUTOLOAD ) =~ s/.*:://;
return constant( $constname, 0 );
}
#
# Backwards compatability package for WWW::Curl::Easy
#
$WWW::Curl::easy::VERSION=$WWW::Curl::Easy::VERSION;
sub WWW::Curl::easy::init
{
return WWW::Curl::Easy::init(@_);
}
sub WWW::Curl::easy::version
{
return WWW::Curl::Easy::version(@_);
}
sub WWW::Curl::easy::setopt
{
return WWW::Curl::Easy::setopt(@_);
}
sub WWW::Curl::easy::perform
{
return WWW::Curl::Easy::perform(@_);
}
sub WWW::Curl::easy::getinfo
{
return WWW::Curl::Easy::getinfo(@_);
}
sub WWW::Curl::easy::cleanup
{
return WWW::Curl::Easy::cleanup(@_);
}
sub WWW::Curl::easy::global_cleanup
{
return WWW::Curl::Easy::global_cleanup(@_);
}
1;
__END__
=head1 AUTHOR
Version 3.00 of WWW::Curl::Easy is a renaming of the previous version, named WWW::Curl::easy.
=head1 Copyright
Copyright (C) 2003,2004 Cris Bailiff
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.
=head1 SEE ALSO
http://curl.haxx.se/
1;
__END__
=head1 NAME
WWW::Curl::Easy - Perl extension interface for libcurl
=head1 SYNOPSIS
use WWW::Curl::Easy;
my $curl = new WWW::Curl::Easy;
$curl->setopt(CURLOPT_URL, 'http://oook.de');
$curl->perform;
my $err = $curl->errbuf;
my $info = $curl->getinfo(CURLINFO_HTTP_CODE);
=head1 DESCRIPTION
WWW::Curl::Easy is a Perl extension interface for libcurl.
=head1 METHODS
$curl = new WWW::Curl::Easy
This method constructs a new WWW::Curl::Easy object.
$curl->setopt( CURLOPT_OPTION, $option )
This method sets a curl option in the object.
$curl->perform
This method performs the object.
$curl->errbuf
This method returns all errors from the buffer of the object.
$curl->getinfo( CURLINFO_OPTION )
This method returns the requested info from the object.
$curl->strerror( ErrNo )
This method returns a string describing the CURLcode error code passed
in the argument errornum.
Aliases for these methods have also been created in the WWW::Curl::easy namespace,
to provide some backwards compatability for existing scripts - you must still
'use WWW:Curl::Easy', but you can keep calling the functions by the lower case name
for now. This will go away in a future release.
=head1 CONSTANTS
These are some short descriptions of the most common constants.
A full list with descriptions can be found in the libcurl
manpages, curl_easy_setopt(3) and curl_easy_getinfo(3).
This binding resembles the C one, so it should be OK to study the
regular libcurl C/C++ API documentation.
CURLOPT_URL
The actual URL to deal with. The parameter should be a scalar.
NOTE: this option is (the only one) required to be set before
perform() is called.
This is a list of all available constants.
@CURLOPT_INCLUDE@
=head1 AUTHOR
Don't use this module for new scripts - use 'WWW::Curl::Easy' instead.
Version 3.02 has some backwards compatibility to v2
Version 3.01 added some support for pre-multi versions of libcurl
Version 3.00 has many new features, new module names and a better
documentation, by Sebastian Riedel.
Version 2.00 of WWW::Curl::easy is a renaming of the previous version
(named Curl::easy), to follow CPAN naming guidelines, by Cris Bailiff.
Versions 1.30, a (hopefully) threadable, object-oriented,
multiple-callback compatible version of Curl::easy was substantially
reworked from the previous Curl::easy release (1.21) by Cris Bailiff.
Original Author Georg Horn <horn@koblenz-net.de>, with additional callback,
pod and test work by Cris Bailiff <c.bailiff+curl@devsecure.com> and
Forrest Cahoon <forrest.cahoon@merrillcorp.com>
Currently maintained by Cris Bailiff <c.bailiff+curl@devsecure.com>
=head1 COPYRIGHT
Copyright (C) 2000,2001,2002,2003,2004 Daniel Stenberg, Cris Bailiff,
Sebastian Riedel, et al.
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.
=head1 SEE ALSO
WWW::Curl, WWW::Curl::Multi, curl_easy_setopt(3), curl_easy_getinfo(3),
http://curl.haxx.se/