::JSON;
use base 'WWW::Snooze::Serialize';
use strict;
use warnings;
sub new {
my $class = shift;
my %args = @_;
bless {
extension => 'json',
mime => 'application/json'
self, $input) = @_;
my $output = JSON->new->allow_nonref->encode($input);
return $output;
}
sub decode {
my ($self, $input) = @_;
my $output = JSON->new->allow_nonref->decode($input);
::Request;
use strict;
use warnings;
use 5.010;
use WWW::Snooze::Serialize::JSON;
use URI;
use LWP::UserAgent;
use JSON;
our $AUTOLOAD;
sub new {
my $class = shift;
my $uri = shift;
m
> [],
args => {},
headers => undef,
serializer => WWW::Snooze::Serialize::JSON->new(),
%args
}, $class;
}
sub AUTOLOAD {
my $self = shift;
my $name = $AUTO
$r->foo();
# Request URL would be http://example.com/foo.json
$r->foo(42)->bar;
# http://example.com/foo/42/bar.json
$r->foo(undef, foo => 'bar');
# http://example.com
, REST operations can be
performed like so:
use WWW::Snooze;
use WWW::Snooze::Serialize::JSON;
use HTTP::Headers;
use Data::Dumper;
my $api = WWW::Snooze::request(
'https
new(
'X-Zen-ApiKey' => 'key'
),
serializer => WWW::Snooze::Serialize::JSON->new(
extension => ''
)
);
my $tasks = $api->projects(40075)->storie
, REST operations can be
performed like so:
use WWW::Snooze;
use WWW::Snooze::Serialize::JSON;
use HTTP::Headers;
use Data::Dumper;
my $api = WWW::Snooze::request(
'https
new(
'X-Zen-ApiKey' => 'key'
),
serializer => WWW::Snooze::Serialize::JSON->new(
extension => ''
)
);
my $tasks = $api->projects(40075)->storie