per $blog->error unless $blog->info();
On success, methods will return a hash reference with the JSON representation
of the upstream response. This behavior has not changed from previous versions
of
$method => 'http://api.tumblr.com/v2/' . $url_path,
[ Accept => 'application/json', Authorization => $request->to_authorization_header ]
);
} elsif ( $method eq 'POST
package WWW::Tumblr::Blog;
use Moose;
use Data::Dumper;
use JSON;
use WWW::Tumblr::API;
extends 'WWW::Tumblr';
has 'base_hostname', is => 'rw', isa => 'Str', required => 1;
tumblr_api_method info
,
extra_args => \%args,
});
if ( $response->is_success ) {
return decode_json( $response->decoded_content)->{response};
} else {
$self->error( WWW::Tumblr::Respons
::Dumper;
use JSON 'decode_json';
has 'response', is => 'rw', isa => 'HTTP::Response';
sub code { $_[0]->response->code }
sub reasons {
my $self = $_[0];
my $j = decode_json( $_[0]->resp
package WWW::Tumblr::API;
use strict;
use warnings;
use Moose;
use JSON 'decode_json';
use Moose::Exporter;
Moose::Exporter->setup_import_methods(with_caller => ['tumblr_api_method']);
use WWW::Tumb
code == 301 || $response->code == 302) && $method_name eq 'avatar') ) {
return decode_json($response->decoded_content)->{response};
} else {
$self->error( WWW::Tumblr::