ePages 7.25.0 - DE_EPAGES/EPagesJ/API/Object/HTTPClient.pm

Package DE_EPAGES::EPagesJ::API::Object::HTTPClient

HTTP communication adapter
All HTTP requests namely get, post, delete have in commen:

Functions

delete
get
new
post
put

delete

Construct and execute a HTTP::Request::Commen::DELETE using $URL and $hHeaders

Syntax
my $HTTPResponse = $Adapter->delete($Path, $hHeader );
Example
my $HTTPResponse = $Adapter->delete($Path, {'PriorityHeader' => true});
Input
$URL (ref.hash)
URL to post to
$hHeaders (ref.hash)
HTTP headers
Return
$HTTPResponse (HTTP::Response)
HTTP::Response object

get

Construct and execute a HTTP::Request::Common::GET request using $URL and $hHeader

Syntax
my $HTTPResponse = $Adapter->get($Path, $hHeaders );
Input
$URL (URI::URL)
URL
$hHeaders (ref.hash)
additional http headers
Return
$HTTPResponse (HTTP::Response)
HTTP::Response object

new

creates a new remote adapter

Syntax
my $Adapter = DE_EPAGES::EPagesJ::API::Object::HTTPClient->new( %options );
Input
%options - used keys:
hash
Return
$Adapter (DE_EPAGES::EPagesJ::API::Object::HTTPClient)
new instance

post

Construct a HTTP::Request::Common::POST using $Content, $hHeaders and execute the request.

Syntax
my $HTTPResponse = $Adapter->post($Path, $hHeader, $Content );
Example
my $HTTPResponse = $Adapter->post($Path, {'PriorityHeader' => true}, 'Body of my POST...' );
Input
$URL (ref.hash)
URL to post to
$hHeaders (ref.hash)
HTTP headers
$Content (String)
Body/Content of POST request
Return
$HTTPResponse (HTTP::Response)
HTTP::Response object

put

Construct a HTTP::Request::Common::put using $Content, $hHeaders and execute the request.

Syntax
my $HTTPResponse = $Adapter->put($Path, $hHeader, $Content );
Example
my $HTTPResponse = $Adapter->put($Path, {'PriorityHeader' => true}, 'Body of my put...' );
Input
$URL (ref.hash)
URL to put to
$hHeaders (ref.hash)
HTTP headers
$Content (String)
Body/Content of put request
Return
$HTTPResponse (HTTP::Response)
HTTP::Response object