NAME

Net::Iugu::Request - Net::Iugu::Request - General HTTP requests to Iugu API

VERSION

version 0.000002

SYNOPSIS

Encapsulates HTTP requests to Iugu API to properly set the headers, encode the data sent and decode the data received.

It is used as base class for other modules and shouldn't be instantiated direclty.

package Net::Iugu::Endpoint;

use Moo;
extends 'Net::Iugu::Request';

...

package main;

use Net::Iugu::Endpoint;

my $endpoint = Net::Iugu::Endpoint->new(
    token => 'my_api_token'
);

my $res = $endpoint->request( $method, $uri, $data );

METHODS

request( $method, $uri, $data )

Encodes the $data as JSON and send it to $uri via $method HTTP method.

The data is received from the webservice as JSON but are inflated to Perl data structures before it returns.

AUTHOR

Blabos de Blebe <blabos@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Blabos de Blebe.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.