Slide 20
Slide 20 text
use strict;
package WebService::Foobar::Request;
use Moo::Role;
use warnings NONFATAL => 'all';
use HTTP::Tiny;
use Carp qw(confess);
has 'ua' => (
is => 'ro',
lazy => 1,
default => sub { HTTP::Tiny->new(
agent => 'WebService-Foobar ',
default_headers =>
{ 'Content-Type' => 'application/json' },
) },
);
has 'base_url' => (
is => 'ro',
lazy => 1,
default => sub { 'http://api.foobar.io/v1/' },
);