Group
Extension

Matches 4

Net-HTTP-API ( F/FR/FRANCKC/Net-HTTP-API-0.14.tar.gz, FRANCKC, 2010; MetaCPAN )
Net-HTTP-API/lib/Net/HTTP/API/Parser/JSON.pm ( view source; MetaCPAN )
t::HTTP::API::Parser::JSON;
BEGIN {
  $Net::HTTP::API::Parser::JSON::VERSION = '0.14';
}

# ABSTRACT: Parse JSON

use JSON;
use Moose;
extends 'Net::HTTP::API::Parser';

has _json_parser => (
    is  
    => 'rw',
    isa     => 'JSON',
    lazy    => 1,
    default => sub { JSON->new->allow_nonref },
);

sub encode {
    my ($self, $content) = @_;
    $self->_json_parser->encode($content);
}

sub 
e {
    my ($self, $content) = @_;
    $self->_json_parser->decode($content);
}

1;


__END__
=pod

=head1 NAME

Net::HTTP::API::Parser::JSON - Parse JSON

=head1 VERSION

version 0.14

=head1 SYNOPSI
Net-HTTP-API ( F/FR/FRANCKC/Net-HTTP-API-0.14.tar.gz, FRANCKC, 2010; MetaCPAN )
Net-HTTP-API/lib/Net/HTTP/API/Role/Format.pm ( view source; MetaCPAN )
oose::Role;
use Moose::Util::TypeConstraints;

sub content_type {
    {   json => {value => 'application/json', module => 'JSON',},
        yaml => {value => 'text/x-yaml',      module => 'YAML'},
   
Net-HTTP-API ( F/FR/FRANCKC/Net-HTTP-API-0.14.tar.gz, FRANCKC, 2010; MetaCPAN )
Net-HTTP-API/lib/Net/HTTP/API/Error.pm ( view source; MetaCPAN )
 error

use Moose;
use JSON;
use Moose::Util::TypeConstraints;
use overload '""' => \&error;

subtype error => as 'Str';
coerce error => from 'HashRef' => via { JSON::encode_json $_};

has http_error 
Net-HTTP-API ( F/FR/FRANCKC/Net-HTTP-API-0.14.tar.gz, FRANCKC, 2010; MetaCPAN )
Net-HTTP-API/lib/Net/HTTP/API.pm ( view source; MetaCPAN )
::HTTP::API;

    # we declare an API, the base_url is http://exemple.com/api
    # the format is json and it will be append to the query
    # You can set api_base_url later, calling $obj->api_base_u
lare my_api => (
        api_base_url    => 'http://exemple.com/api',
        api_format      => 'json',
        api_format_mode => 'append',
    );

    # declaring a users method
    # calling $obj-
   net_api_declare backtype => (
        base_url    => 'http://api....',
        format      => 'json',
        format_mode => 'append',
    );

=over 2

=item B<api_base_url>

The base url for all t

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.