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

NAME

WebService::MyGengo::RequestFactory - A factory for creating myGengo API requests

DESCRIPTION

Returns various WebService::MyGengo::Request objects to be sent to the API.

SYNOPSIS

    # Note: Requests are usually created automatically by WebService::MyGengo::Client
    my $req_factory = new WebService::MyGengo::RequestFactory({
        public_key      => $pubkey
        , private_key   => $privkey
        , root_uri      => $api_uri
        });

    my $req = $req_factory->new_request( $method, $endpoint, \%params );

    # Alternate constructor syntax
    my $req_factory = new WebService::MyGengo::RequestFactory(
        $pubkey
        , $privkey
        , $api_uri
        );

ATTRIBUTES

All attributes are read-only. If, for some reason, you need to generate requests for a different keypair or root_uri, just make a new RequestFactory.

public_key (Str)

Your public API key.

private_key (Str)

Your private API key

root_uri (URI)

The URI to be used as the base for all API endpoints.

eg, 'http://api.sandbox.mygengo.com/v1.1'

METHODS

new_request( $request_method, $endpoint, \%params )

Returns an HTTP::Request object for the given API endpoint.

AUTHOR

Nathaniel Heinrichs

LICENSE

Copyright (c) 2011, Nathaniel Heinrichs <nheinric-at-cpan.org>. All rights reserved.

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.