API-Drip-Request
view release on metacpan or search on metacpan
lib/API/Drip/Request.pm view on Meta::CPAN
A codref that should accept a list of diagnostic strings and log them somewhere
useful for debugging purposes. Only used when DRIP_DEBUG is true.
=back
=cut
my $config_validator = validation_for(
params => {
DRIP_CLIENT_CONF => { type => Str(), optional => 1 },
map { $_ => { type => Str(), optional => 1 } } keys %DEFAULTS,
debugger => { type => CodeRef(), optional => 1 },
}
);
sub new {
my $class = shift;
my %OPT = $config_validator->(@_);
my $self = _load_conf( \%OPT );
lib/API/Drip/Request.pm view on Meta::CPAN
bless $self, $class;
return $self;
}
sub _mk_debugger {
my ($self, %OPT) = @_;
unless ($self->{DRIP_DEBUG}) { return sub {}; }
if ( $OPT{debugger} ) { return $OPT{debugger} }
return sub { warn join "\n", map { ref($_) ? np $_ : $_ } @_ };
}
=head2 do_request
Accepts the following positional parameters:
=over
=item HTTP Method (required)
( run in 0.408 second using v1.01-cache-2.11-cpan-49f99fa48dc )