Package DE_EPAGES::EPagesJ::API::Object::HTTPClient
HTTP communication adapter
All HTTP requests namely get, post, delete
have in commen:
- They apply default HTTP header to each request provided by new
- They throw an error 'REQUEST_FAILED' if HTTP::Response::is_success() is false
or the response don't arrive in a timely manner.
The Response time limit can be set by calling by $Client->userAgent->timeout($seconds), default timeout is 10 seconds.
Functions
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 |
|
Return |
|
get
Construct and execute a HTTP::Request::Common::GET request using $URL and $hHeader
Syntax |
my $HTTPResponse = $Adapter->get($Path, $hHeaders ); |
Input |
|
Return |
|
new
creates a new remote adapter
Syntax |
my $Adapter = DE_EPAGES::EPagesJ::API::Object::HTTPClient->new( %options ); |
Input |
|
Return |
|
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 |
|
Return |
|
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 |
|
Return |
|