pi/ping.json',
'SERVER_NAME' => 'perl.org',
'HTTP_CONNECTION' => 'TE, close',
'REQUEST_METHOD' => 'GET',
'SCRIPT_URI' => 'http://www.perl.org/dwarf/test/api/ping.json',
'SC
RIPT_FILENAME' => '/dwarf/test/api/ping.json',
'SERVER_SOFTWARE' => 'Apache/1.3.27 (Unix) ',
'HTTP_TE' => 'deflate,gzip;q=0.3',
'QUERY_STRING' => 'hoge=あいうえお&name[]=
=> '/dwarf/test/api/ping.json',
'REQUEST_URI' => '/dwarf/test/api/ping.json',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'SCRIPT_URL' => '/dwarf/test/api/ping.json',
'SERVER_ADDR' =
arf::Pragma;
use JSON;
use Test::More 0.88;
subtest "boolean" => sub {
ok true;
ok !false;
ok (1 == 1);
ok !(1 == 0);
my $json = JSON->new->convert_blessed;
my $encoded = $json->encode({ false
=> false, true => true });
my $decoded = $json->decode($encoded);
#is $encoded, '{"false":false,"true":true}';
};
done_testing();
vice::Wikimapia - Interface to Wikimapia API.
=head1 VERSION
Version 0.14
=cut
use 5.006;
use JSON;
use Data::Dumper;
use WebService::Wikimapia::UserAgent;
use WebService::Wikimapia::Category;
us
ub { return 'none'; });
has 'format' => (is => 'ro', isa => $Format, default => sub { return 'json'; });
=head1 DESCRIPTION
Wikimapia API is a system that allows you to receive data from Wikimap
('place.getbyid', $fields, $params);
my $response = $self->get($url);
my $contents = from_json($response->{content});
return WebService::Wikimapia::Place->new($contents);
}
=head2 place_
= Dwarf->new;
my ($class, $ext) = $c->find_class('/api/ping.json');
is_deeply([ $class, $ext ], [ 'Dwarf::Controller::Api::Ping', 'json' ], 'works fine');
};
subtest "find_method" => sub {
my $c
};
sub check_disable { return exists $DISABLE->{lc($_[0])}; }
our $FORMAT = { 'xml' => 1, 'json' => 1, 'jsonp' => 1, 'kml'=> 1, 'binary' => 1 };
our $Format = sub { die "ERROR: Invalid data type 'for
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::
#!perl -w
package main;
use strict;
use JSON 'decode_json';
use Finance::Bank::Postbank_de::APIv1;
use Mojolicious::Lite;
use POSIX 'strftime';
use Getopt::Long;
use Pod::Usage;
GetOptions(
'use
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
l::Valid::Loose;
use Dwarf::Util qw/encode_utf8 decode_utf8/;
use Image::Info qw/image_type/;
use JSON;
use MIME::Base64 qw(decode_base64 decoded_base64_length);
use Scalar::Util qw/looks_like_number/
ref $callback ne 'CODE';
$callback->($_);
};
rule JSON => sub {
my $value = $_;
return 1 unless defined $value;
my $data = eval { decode_json encode_utf8 $value };
if ($@) {
warn $@;
warn $
::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
pi/ping.json',
'SERVER_NAME' => 'perl.org',
'HTTP_CONNECTION' => 'TE, close',
'REQUEST_METHOD' => 'POST',
'SCRIPT_URI' => 'http://www.perl.org/dwarf/test/api/ping.json',
'S
CRIPT_FILENAME' => '/dwarf/test/api/ping.json',
'SERVER_SOFTWARE' => 'Apache/1.3.27 (Unix) ',
'HTTP_TE' => 'deflate,gzip;q=0.3',
'QUERY_STRING' => 'hoge=a&name[]=hoge&name[1]=
=> '/dwarf/test/api/ping.json',
'REQUEST_URI' => '/dwarf/test/api/ping.json',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'SCRIPT_URL' => '/dwarf/test/api/ping.json',
'SERVER_ADDR' =
::Module';
use Dwarf::Validator;
use Dwarf::Validator::Constraint;
use Dwarf::Util qw/safe_decode_json encode_utf8/;
use Carp qw/croak/;
use HTTP::Date;
use Dwarf::Accessor {
ro => [qw/autoflush_val
09/08/x-frame-options/
$self->init_plugins($c);
$self->type('application/json; charset=UTF-8');
# defense from JSON hijacking
my $user_agent = $c->req->user_agent || '';
my $request_method =
atus(403);
$c->res->content_type('text/html; charset=utf-8');
$c->finish("Your request may be JSON hijacking.\nIf you are not an attacker, please add 'X-Requested-With' header to each request.");
Digest::SHA qw//;
use Encode qw/encode_utf8/;
use HTTP::Request::Common;
use HTTP::Response;
use JSON;
use LWP::UserAgent;
use Net::OAuth;
use Dwarf::Accessor qw/
ua ua_async urls
key secret
requ
{
my ($self, $src, $message) = @_;
my $url = $self->urls->{api} . '/statuses/update_with_media.json';
my $oauth = Net::OAuth->request('protected resource')->new(
version => '1.0',
re
auth_request(
'protected resource',
request_url => $self->urls->{api} . '/' . $command . '.json',
request_method => $method,
extra_params => $params,
token => $self->access_tok
#!perl -w
package main;
use strict;
use WWW::Mechanize;
use LWP::Protocol::https;
use JSON 'decode_json';
#use LWP::ConsoleLogger::Easy qw( debug_ua );
use HTTP::CookieJar::LWP;
use Data::Dumper;
use
package HAL::Resource;
use Moo;
use JSON 'decode_json';
use Filter::signatures;
no warnings 'experimental::signatures';
use feature 'signatures';
use Future;
use Carp qw(croak);
our $VERSION = '0.57
'https://api.example.com/');
my $r = HAL::Resource->new(
ua => $ua,
%{ decode_json( $res->decoded_content ) },
);
=head1 ABOUT
This module is just a very thin wrapper for HAL
TTP transfer facility and
currently fails its test suite
L<HAL::Tiny> - a module to generate HAL JSON
L<WebAPI::DBIC::Resource::HAL> - an adapter to export DBIx::Class structures
as HAL
Hypertext A
rf::Pragma;
use parent qw(Exporter);
use Encode ();
use File::Basename ();
use File::Path ();
use JSON ();
use Scalar::Util qw(blessed refaddr);
our @EXPORT_OK = qw/
add_method
load_class
installe
y
filename
read_file
write_file
get_suffix
safe_join
merge_hash
random_string
safe_decode_json
encode_utf8
decode_utf8
encode_utf8_recursively
decode_utf8_recursively
apply_recursively
d
and 36];
}
return $str;
}
# decode_json の undef 対策
sub safe_decode_json {
my ($data) = @_;
return undef unless defined $data;
return JSON::decode_json($data);
}
# Encode-2.12 以下対策
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
package Finance::Bank::Postbank_de::APIv1;
use Moo;
use JSON 'decode_json';
use Filter::signatures;
no warnings 'experimental::signatures';
use feature 'signatures';
use Carp 'croak';
use WWW::Mechani
tps://meine.postbank.de/configuration.json');
};
if( my $err = $@ ) {
$self->diagnoseCertificateError( "$@ ");
};
my $config = decode_json( $ua->content );
if( ! exists $co
'device-signature' => $config->{'iob5-base'}->{apiKey},
accept => ['application/hal+json', '*/*'],
keep_alive => 1,
# / business
pi/ping.json',
'SERVER_NAME' => 'perl.org',
'HTTP_CONNECTION' => 'TE, close',
'REQUEST_METHOD' => 'GET',
'SCRIPT_URI' => 'http://www.perl.org/dwarf/test/api/ping.json',
'SC
RIPT_FILENAME' => '/dwarf/test/api/ping.json',
'SERVER_SOFTWARE' => 'Apache/1.3.27 (Unix) ',
'HTTP_TE' => 'deflate,gzip;q=0.3',
'QUERY_STRING' => '',
'REMOTE_PORT' =>
=> '/dwarf/test/api/ping.json',
'REQUEST_URI' => '/dwarf/test/api/ping.json',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'SCRIPT_URL' => '/dwarf/test/api/ping.json',
'SERVER_ADDR' =
#!perl -w
package main;
use strict;
use WWW::Mechanize;
use LWP::Protocol::https;
use JSON 'decode_json';
#use LWP::ConsoleLogger::Easy qw( debug_ua );
use HTTP::CookieJar::LWP;
use Data::Dumper;
use