API-Drip-Request
view release on metacpan or search on metacpan
lib/API/Drip/Request.pm view on Meta::CPAN
use API::Drip::Request;
my $drip = API::Drip::Request->new();
$drip->do_request( POST => 'subscribers', { subscribers => [ { email => 'foo@example.com', ... }] } );
=head1 DESCRIPTION
Low-level perl interface to the Drip API as specified at https://www.getdrip.com/docs/rest-api
All of the methods in this module will throw exceptions on error.
=head1 SUBROUTINES/METHODS
=head2 new()
Creates the API::Drip::Request object. See L</"CONFIGURATION"> for accepted parameters.
Also accepts:
=over
lib/API/Drip/Request.pm view on Meta::CPAN
Specifies the path of the REST enpoint you want to query. Include everything after the account ID. For example, "subscribers", "subscribers/$subscriber_id/campaign_subscriptions", etc...
=item Content (optional)
Perl hashref of data that will be sent along with the request.
=back
On success, returns a Perl data structure corresponding to the data returned
from the server. Some operations (DELETE), do not return any data and may
return undef on success. On error, this method will die() with the
HTTP::Response object.
=cut
my $request_validator = validation_for( params => [ {type => Str()}, {type => Str()}, {type => HashRef(), optional => 1} ] );
sub do_request {
my $self = shift;
my ($method, $endpoint, $content) = $request_validator->(@_);
my $uri = URI->new($self->{DRIP_URI});
( run in 0.566 second using v1.01-cache-2.11-cpan-65fba6d93b7 )