NAME

XAS::Lib::Curl::HTTP - A class for the XAS environment

SYNOPSIS

 use HTTP::Request;
 use XAS::Lib::Curl::HTTP;

 my $response;
 my $request = HTTP::Request->new(GET => 'http://scm.kesteb.us/trac');
 my $ua = XAS::Lib::Curl::HTTP->new();

 $response = $ua->request($request);
 print $response->content;

DESCRIPTION

This module uses libcurl as the HTTP engine to make requests from a web server.

METHODS

All true/false values use 0/1 as the indicator.

new

This method initializes the module and takes the following parameters:

-keep_alive

A toggle to tell curl to forbid the reuse of sockets, defaults to true.

-follow_location

A toggle to tell curl to follow redirects, defaults to true.

-max_redirects

The number of redirects to follow, defaults to 3.

-timeout

The timeout for the connection, defaults to 60 seconds.

-connect_timeout

The timeout for the initial connection, defaults to 300 seconds.

-auth_method

The authentication method to use, defaults to 'noauth'. Possible values are 'any', 'basic', 'digest', 'ntlm', 'negotiate'. If a username and password are supplied, curl defaults to 'basic'.

-password

An optional password to use, implies a username. Wither the password is actually used, depends on -auth_method.

-username

An optional username to use, implies a password.

-ssl_cacert

An optional CA cerificate to use.

-ssl_keypasswd

An optional password for a signed cerificate.

-ssl_cert

An optional certificate to use.

-ssl_key

An optional key for a certificate to use.

-ssl_verify_host

Wither to verify the host certifcate, defaults to true.

-ssl_verify_peer

Wither to verify the peer certificate, defaults to true.

-proxy_url

The url of a proxy that needs to be transversed.

-proxy_auth

The authentication method to use, defaults to 'noauth'. Possible values are 'any', 'basic', 'digest', 'ntlm', 'negotiate'. If a proxy username and a proxy password are supplied, curl defaults to 'basic'.

-proxy_password

An optional password to use, implies a username. Wither the password is actually used, depends on -proxy_auth.

-proxy_username

An optional username to use, implies a password.

request($request)

This method sends the requset to the web server. The request will return a HTTP::Response object. It takes the following parameters:

$request

A HTTP::Request object.

SEE ALSO

XAS
WWW::Curl
libcurl

AUTHOR

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE

Copyright (C) 2014 Kevin L. Esteb

This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.