ePages 6.14.0 - DE_EPAGES/Core/API/Object/RestClient.pm

Package DE_EPAGES::Core::API::Object::RestClient

base class for rest clients

Base
DE_EPAGES::Core::API::Object::BaseObject

Functions

getBasePath
getServiceUrl
logger
new
sendRequest

getBasePath

Returns the configuration of a service.

Syntax
my $hConf = $Client->getBasePath();
Return
$BasePath (string)
rest service base path, default: 'http://localhost:8088/rs'

getServiceUrl

Returns the url for a service. (e.g. 'http://localhost:8088/rs/pdf')

Syntax
my $Url = $Client->getServiceUrl();
Return
$Url (string)
service url

logger

Prints output to a file for logging and debugging purposes.

Syntax
$Client->logger();
Input
$Type (string)
type of request (e.g. send, receive..)
$Status (string)
status of response (e.g. '200 OK')
$Content (string or binary)
processed content

new

Create a new rest-client object.

Syntax
my $Client = DE_EPAGES::Core::API::Object::RestClient->new(
    'Alias' => 'pdf',
    'Header' => { 'Content_Type'=>'text/html', }
);
Input
%Attributes (hash)
attribute value hash
Return
$Client (DE_EPAGES::Core::API::Object::RestClient)
blessed object

sendRequest

Send a request to the service provider and return the answer.

Syntax
my $Answer = $Client->sendRequest( $Content );
Input
$Content (string)
data to send to the service provider
Return
$Answer (string or binary)
data received from service provider