The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SimpleAPI::Agent - Role for custom user agents

SYNOPSIS

    package MyApp::Model::ServiceApp;

    use Moose;
    use namespace::autoclean;

    extends 'Catalyst::Model';

    with 'SimpleAPI::Agent';

    __PACKAGE__->config(
        api_key => 'AE281S228D4',
        application_id => 'myapp',
        api_base_url => 'http://localhost:5000/'
    );

    1;

DESCRIPTION

A role for building custom user agents which provides a request method to interface with CatalystX::SimpleAPI apps.

ATTRIBUTES

api_key

String used as authorization token.

application_id

Application's identification which can be a number, UUID, name, etc.

api_base_url

Base URL to send request to. That is concatenated with the path supplied as arg on the call to request.

METHODS

request( $relative_path, $params?, $http_method? )
do_request( $http_method, $uri_obj, $params? )
handle_response( $http_response_obj )

AUTHOR & LICENSE

See CatalystX::SimpleAPI.