AsposeWordsCloud-WordsApi

 view release on metacpan or  search on metacpan

lib/AsposeWordsCloud/ApiClient.pm  view on Meta::CPAN

package AsposeWordsCloud::ApiClient;

use strict;
use warnings;
use utf8;

use MIME::Base64;
use LWP::UserAgent;
use HTTP::Headers;
use HTTP::Response;
use HTTP::Request::Common qw(DELETE POST GET HEAD PUT);
use HTTP::Status;
use URI::Query;
use JSON;
use URI::Escape;
use Scalar::Util;
use Log::Any qw($log);
use Carp;
use Module::Runtime qw(use_module);
use Digest::HMAC_SHA1;
use MIME::Base64;

use AsposeWordsCloud::Configuration;

sub new
{
	
	if(not defined $AsposeWordsCloud::Configuration::app_sid or $AsposeWordsCloud::Configuration::app_sid eq ''){
		croak("Aspose Cloud App SID key is missing.");
    }
	
	if(not defined $AsposeWordsCloud::Configuration::api_key or $AsposeWordsCloud::Configuration::api_key eq ''){
		croak("Aspose Cloud API key is missing.");
    }
    
    my $class = shift;
    my (%args) = (
        'ua' => LWP::UserAgent->new,
        'base_url' => $AsposeWordsCloud::Configuration::api_server,
        @_
    );
  
    return bless \%args, $class;
}

# Set the user agent of the API client
#
# @param string $user_agent The user agent of the API client
#
sub set_user_agent {
    my ($self, $user_agent) = @_;
    $self->{http_user_agent}= $user_agent;
}

# Set timeout
#
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
# 
sub set_timeout {
    my ($self, $seconds) = @_;
    if (!looks_like_number($seconds)) {
        croak('Timeout variable must be numeric.');
    }
    $self->{http_timeout} = $seconds;
}

# make the HTTP request
# @param string $resourcePath path to method endpoint
# @param string $method method to call
# @param array $queryParams parameters to be place in query URL
# @param array $postData parameters to be placed in POST body



( run in 2.414 seconds using v1.01-cache-2.11-cpan-d8267643d1d )