vice::Pinterest::Pager;
use HTTP::Request;
use HTTP::Request::Common ();
use LWP::UserAgent;
use JSON::XS;
use Carp qw(croak);
use namespace::autoclean;
has app_id => (
is => 'ro',
p
}
# Decode JSON content
my $r;
if ( $res && $res->content_type eq 'application/json' ) {
my $json = $res->decoded_content;
$r = eval { decode_json($json) };
if (
my $err = $@ ) {
$r = { _error => 'bad_json', _message => $err, json => $json };
}
}
$r //= { _error => 'not_json', _content_type => $res->content_type };
$r->{_http_s