ldTimeS => 0,
name => "foo",
pendingTask => bless(do{\(my $o = 0)}, "JSON::PP::Boolean"),
updatedAt => "2014-12-04T00:41:14.120Z",
},
{
create
ldTimeS => 0,
name => "bar",
pendingTask => bless(do{\(my $o = 0)}, "JSON::PP::Boolean"),
updatedAt => "2014-12-04T00:42:13.231Z",
}]
=head2 browse_index
ask_status('foo', 29734242);
B<Response:>
{
pendingTask => bless(do{\(my $o = 0)}, "JSON::PP::Boolean"),
status => "published",
}
=head2 get_keys
Retrieves global API keys
Service::Rakuten::API;
use 5.008005;
use strict;
use warnings;
use LWP::UserAgent;
use Mouse;
use JSON;
use URI;
our $VERSION = "0.06";
use WebService::Rakuten::API::Provider::Travel;
use WebService::
appid => __YOURAPI__
);
my $items = $rakuten->ichiba({keyword => '遊戯王',format => 'json'});
print $items->{Items}->[0]->{Item}->{itemName};
=head1 DESCRIPTION
WebService::Rakuten
l->query_form(applicationId => $context->appid,format=>$arg->{format},keyword =>$arg->{keyword});
my $res = $context->furl->get($url);
my $response = JSON::decode_json($res->decoded_content);
}
1;
package Geo::Coder::TomTom;
use strict;
use warnings;
use Carp qw(croak);
use Encode ();
use JSON;
use LWP::UserAgent;
use URI;
our $VERSION = '0.04';
$VERSION = eval $VERSION;
sub new {
my ($
=> 'json',
%params,
);
my $res = $self->{response} = $self->ua->get($uri);
return unless $res->is_success;
# Change the content type of the response from 'application/json' s
my $content = $res->decoded_content;
return unless $content;
my $data = eval { from_json($content) };
return unless $data;
# Result is a list only if there is more than one item
$cgi->set_header('myheader', 'whatever');
# change content type
$cgi->set_content_type('text/json');
# output HTTP headers, including added cookies, the CSRF cookie,
# and the new header
prin
GgpkZ4; path=/
# Date: Sun, 29 Jul 2012 04:08:06 GMT
# Myheader: whatever
# Content-Type: text/json; charset=ISO-8859-1
=head1 INSTALLATION
CGI::Plus can be installed with the usual routine:
pe
a::App::Command::weaverconf::VERSION = '0.05';
use Dist::Zilla::App -command;
use Moose 0.91;
use JSON::MaybeXS ();
use List::Util qw(first);
use MooseX::Types::Moose qw(Str CodeRef);
use MooseX::Type
ar
#pod output format. The following formats are currently available:
#pod
#pod =for :list
#pod * json
#pod the default
#pod * lisp
#pod a plist of lists of plists
#pod
#pod =cut
has formatters => (
> sub { Dist::Zilla::App::CommandHelper::weaverconf::SExpGen->new->visit($_[0]) },
json => sub { JSON::MaybeXS->new(utf8 => 1, pretty => 1, canonical => 1)->encode($_[0]) },
};
}
sub abst
SMS service
use Carp;
use HTTP::Tiny;
use URI::Escape qw( uri_escape );
use JSON::MaybeXS qw( decode_json encode_json JSON );
use base 'SMS::Send::Driver';
sub new {
my $class = shift;
my
# to ensure the response is JSON and not the XML default
'accept' => 'application/json; charset=utf-8',
'content-type' => 'application/json; charset=utf-8',
},
nt => encode_json(\%message),
}
);
# for example a timeout error
die $response->{content}
unless $response->{success};
my $response_message = decode_json( $response->
}
sub json {
require Mojo::JSON;
require Mojo::JSON::Pointer;
my $data = Mojo::JSON::decode_json(shift);
return @_ ? Mojo::JSON::Pointer->new($data)->get(shift) : $data;
}
*j = \&json;
sub
e_stream->trim;
# "Text"
'<p>Text</p>'->dom->at('p')->text;
# "world"
'{"hello": "world"}'->json->{hello};
# "anchor"
'http://mysite.com/path#anchor'->url->fragment;
=head1 DESCRIPTION
Str
ead2 json
Parses the invocant string as JSON using L<Mojo::JSON/decode_json> and returns the result.
Optionally takes a JSON pointer used to delve into the resulting structure using L<Mojo::JSON::Poi
strict;
use Mojo::Autobox;
# "site.com\n"
'{"html": "<a href=\"http://site.com\"></a>"}'
->json('/html')
->dom->at('a')->{href}
->url->host
->byte_stream->say;
=head1 DESCRIPTION
Usi
);
# qw(OK)
use Apache2::Const -compile => qw(:common); # 'OK', 'DECLINED'
use APR::Table ();
use JSON::XS;
use JRPC; # Import ... ?
*jdie = JRPC::createfault;
#use Storable (); # Would import store -
ache2::RequestUtil;
=head1 NAME
JRPC::Apache2 - JSON-RPC Services in Apache2 / mod_perl runtime
=head1 DESCRIPTION
This package is a mod_perl JSON-RPC handler / dispatcher. It only contains the co
SetHandler modperl
PerlResponseHandler JRPC::Apache2
</Location>
=cut
# Parse and handle JSON-RPC Request.
# reads POST body by $r->read($buffer, $len).
# if/else dispatching (of 3 meth) give
strict;
use Mojo::Autobox;
# "site.com\n"
'{"html": "<a href=\"http://site.com\"></a>"}'
->json('/html')
->dom->at('a')->{href}
->url->host
->byte_stream->say;
=head1 DESCRIPTION
Usi
tfile';
use TntCompat::Cat::SnapMsgpack;
use TntCompat::Cat::Snap;
use TntCompat::Cat::Xlog;
use JSON::XS;
use File::Basename 'basename';
use feature 'state';
sub strhex($) {
my ($str) = @_;
$res[ $fno ];
}
} elsif ('JSON' eq uc $ftype) {
# TODO: decode str
$res[ $fno ] = JSON::XS->new->decode($res[ $fno ] );
} elsi
string $_->[2];
}
} elsif ('JSON' eq uc $type) {
# TODO: decode str
$_->[2] = JSON::XS->new->decode($_->[2] );
} else {
package JRPC::Nginx;
use JRPC;
use JSON::XS;
# require - to avoid symbol resolution problems ?
require nginx; # nginx / Nginx ?
use strict;
use warnings;
our $VERSION = "0.9";
# See Perldoc at the e
.
#This encapsulates the
#=cut
sub handle_2nd_stage {
my ($r) = @_;
my $jr = {'id' => $$, 'jsonrpc' => '2.0', };
my $buffer = $r->request_body();
eval {
# Parse Request
my $j =
now) that do not serialize
# well. Be ready to encounter exceptions here.
my $out = JSON::XS::encode_json($jr); # Serialize as a separate step to know length
################# Nginx Outpu
L<DBI>
=head3 L<DBD::SQLite>
=head2 Data Manipulation
=head3 L<Const::Fast>
=head3 L<JSON>
=head3 L<JSON::XS>
=head3 L<List::MoreUtils>
=head3 L<Regexp::Common>
=head3 L<XML::LibXML>
=head3
);
$self->strict_ssl(1);
$self->content_type('application/json');
$self->default_method('POST');
$self->extension('json');
$self->base_url('https://mandrillapp.com/api/1.0');
$
Send Requests to a JSON-RPC Service.
# We completely ride on the wonderful LWP Module.
{
package JRPC::Client;
#
use LWP;
use LWP::UserAgent;
use base ('LWP::UserAgent');
use JSON::XS;
use Data::Dump
er;
#our $mime;
#BEGIN {
# De-facto JSON-RPC Mime type
our $mime = 'application/json';
#};
=head1 NAME
JRPC::Client - JSON-RPC 2.0 Client
=head1 SYNOPSIS
use JRPC::Client;
my $client = JRP
so'}\n");
=head1 DESCRIPTION
JRPC::Client is a Perl LWP based JSON-RPC 2.0 Client hoping to minimize tedious boilerplate code for JSON-RPC
interaction, yet enabling advanced use cases by the power o
mon::sense;
our $VERSION = '0.200';
use AnyEvent;
use AnyEvent::Util;
use AnyEvent::Handle;
use JSON::XS;
use File::ShareDir;
use Scalar::Util;
use Alien::Thrust;
use Thrust::Window;
our $THRUST
($level, $msg_cb, $to_dump, $indent) = @_;
return if $level > $ENV{THRUST_DEBUG};
$js ||= JSON::XS->new->pretty->canonical;
my $out = "\n" . $msg_cb->() . "\n";
$out .= $js->encode($to_d
my $line_handler; $line_handler = sub {
my ($hdl, $line) = @_;
my $msg = eval { decode_json($line) };
if (defined $msg) {
debug(1, sub { "<<<<<<<<<<<<<<<<< Message from thrust s
ge Bio::Taxonomy::GlobalNames;
use 5.10.0;
use strict;
use warnings;
use JSON qw(encode_json);
use JSON::Parse qw(parse_json);
use LWP::UserAgent;
use Moo::Lax;
use REST::Client;
use Scalar::Readonl
sing a REST client,
input is sent to the service, whereas results are internally converted
from JSON format to nested objects and returned to the user.
This module can be used for automated standar
resolvers.json';
}
elsif ( _check_status('http://resolver.globalnames.biodinfo.org') )
{
$gnr_url =
'http://resolver.globalnames.biodinfo.org/name_resolvers.json';
}
qw/:config gnu_compat/;
use Pod::Usage;
GetOptions(\my %opts, qw(
help|? man verbose dump yaml json colour|color save|to_file dir=s metrics_path=s@
));
pod2usage(1) if $opts{help};
pod2usage(-exit
sult using Data::Dumper
--yaml dump result as YAML
--json dump result as JSON
--save write report (or dump) to a file
--dir
tead of displaying a report text).
=head2 --yaml
Dump the result as YAML.
=head2 --json
Dump the result as JSON.
=head3 --save
Output the result into a file instead of STDOUT.
The name of the f
#{
package JRPC;
use JSON::XS;
use Data::Dumper;
use strict;
use warnings;
#UNUSED:my $rstub = {'id' => 66666, 'jsonrpc' => '2.0'};
our $VERSION = '0.61';
# 0 = No validation (trust client, any excep
Require 'id','jsonrpc', 3
our $msgvalid = 1;
# This is prelogger callback. MUST be a _hard_ CODE ref to be used (not symbolic reference).
our $prelogger;
=head1 NAME
JRPC - Create JSON-RPC Services
focusing on app logic, not worrying about the details of JSON-RPC Processing.
=head1 SYNOPSIS
use JRPC;
# Load one of the Service modules JRPC::CGI, JRPC::Apache2 or JRPC::Nginx
# See part