root_location
server_root
html_dir
server_port
no_nginx_manager
);
#use Smart::Comments::JSON '###';
use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
use POSIX qw(EAGAIN);
use IO::Socket;
#our ($Pr
_drizzle
L<http://github.com/chaoslawful/drizzle-nginx-module>
=item ngx_rds_json
L<http://github.com/agentzh/rds-json-nginx-module>
=item ngx_xss
L<http://github.com/agentzh/xss-nginx-module>
=
ABSTRACT: PunchTab REST API
use strict;
use warnings;
use LWP::UserAgent;
use MIME::Base64;
use JSON;
use Digest::SHA;
use Carp;
use vars qw/$errstr/;
sub errstr { $errstr }
sub new {
my $class
f = shift;
my %user = @_ % 2 ? %{ $_[0] } : @_;
my $auth_request = encode_base64( encode_json( \%user ) );
my $timestamp = time();
my $signature = Digest::SHA::hmac_sha1_hex( "$
>is_success ) {
$errstr = $resp->status_line;
return;
}
my $data = decode_json( $resp->decoded_content );
if ( $data->{error} ) {
$errstr = $data->{error}->{descrip
::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
:Log;
BEGIN {
$Poet::t::Log::VERSION = '0.13';
}
use Poet::Tools qw(rmtree tempdir_simple);
use JSON::XS;
use Test::Class::Most parent => 'Poet::Test::Class';
__PACKAGE__->initialize_temp_env();
s
my $log_conf = Poet::Log->generate_log4perl_config();
is( $log_conf, $expected, encode_json($conf_settings) );
};
my $default_layout = "%d{dd/MMM/yyyy:HH:mm:ss.SS} [%p] %c - %m - %
e32 qw( RFC );
use MIME::Base64;
use Digest::SHA qw( sha1 hmac_sha256 );
use Crypt::Rijndael;
use JSON;
use LWP::UserAgent;
use Storable;
our $VERSION = '0.04';
our @ISA = qw(Exporter);
our @EXPORT
he server.
my $ret = fetch_json($self, $self->{'base_url'} . 'storage/' . $collection . '?full=1');
# The 'payload' elements of the fetched array contain a JSON object that
# has to be de
ach my $item (@$ret) {
my $json = decrypt_collection($self, decode_json($item->{'payload'}), $collection);
# What we see now, looks like another JSON object, but it contains some
_drizzle
L<http://github.com/chaoslawful/drizzle-nginx-module>
=item ngx_rds_json
L<http://github.com/agentzh/rds-json-nginx-module>
=item ngx_rds_csv
L<http://github.com/agentzh/rds-csv-nginx-mo
_json ($data)
Output the JSON-encoded I<$data>, set the content type to "application/json",
and abort. e.g.
method handle {
my $data;
# compute data somehow
$m->send_json
($data);
}
C<send_json> is a shortcut for
$m->clear_buffer;
$m->print(JSON::XS::encode_json($data));
$m->res->content_type("application/json");
$m->abort();
=back
=head1 SEE AL
ormsMultipart',
'application/xml' => 'HTTP::Body::XForms',
'application/json' => 'HTTP::Body::OctetStream',
};
require HTTP::Body::OctetStream;
require HTTP
ON
HTTP::Body parses chunks of HTTP POST data and supports
application/octet-stream, application/json, application/x-www-form-urlencoded,
and multipart/form-data.
Chunked bodies are supported by not
RSION = '0.02';
use JavaScript::V8;
use JSON::XS;
sub new {
my $self = bless {};
$self->{context} = JavaScript::V8::Context->new();
$self->{json} = JSON::XS->new->allow_nonref;
$self->{templa
e_string;
my $template_string_json = $self->{json}->encode($template_string);
die "need a template_name" unless $template_name;
my $template_name_json = $self->{json}->encode($template_name);
$s
var template_string = $template_string_json;
var template = swig.compile(template_string, { filename: $template_name_json });
templates[$template_name_json] = template;
false;
EOT
confess $@ if
RSION = '0.13';
}
use Mason::PluginRole;
use Poet qw($conf $poet);
use Poet::Plack::Response;
use JSON::XS;
use Try::Tiny;
has 'req' => ( is => 'ro', required => 1, isa => 'Object' );
has 'res' => (
elf->req->session;
}
method send_json ($data) {
$self->clear_buffer;
$self->print( JSON::XS::encode_json($data) );
$self->res->content_type("application/json");
$self->abort();
}
1;
package WebService::XING;
use 5.010;
use Carp ();
use Digest::SHA ();
use JSON ();
use LWP::UserAgent;
use HTTP::Headers; # ::Fast
use HTTP::Request;
use Mo 0.30 qw(builder chain is required);
use
st_timeout', chain => 1);
sub _build_request_timeout { 30 }
has json => (builder => '_build_json', chain => 1);
sub _build_json { JSON->new->utf8->allow_nonref }
has warn => (builder => '_build_warn
_build__headers');
sub _build__headers {
HTTP::Headers->new(
# Accept => 'application/json, text/javascript, */*; q=0.01',
'Accept-Encoding' => 'gzip, deflate',
)
}
### Funct
reported back with: $result") unless $result->content_type eq 'application/json';
my $repo_info = $result->content_json;
$self->log_fatal("Travis CI cannot find your repository; did you forget
reported back with: $result") unless $result->content_type eq 'application/json';
my $build_info = $result->content_json;
$self->log_fatal("Travis CI cannot find your build?!?")
if (ref
ent->agent(__PACKAGE__);
#$UserAgent->default_headers(HTTP::Headers->new);
#use Smart::Comments::JSON '##';
our @EXPORT = qw( plan run_tests run_test
repeat_each config_preamble worker_connectio
;
use strict;
use warnings;
use Moo;
extends 'WWW::ASN::Downloader';
use WWW::ASN::Standard;
use JSON;
=head1 NAME
WWW::ASN::Document - Represents a collection of standards or learning objectives
return $self->_read_or_download(
$self->manifest_cache_file,
$self->uri_manifest_json,
);
}
=head2 id
This is a globally unique URI for this document.
=cut
has 'id' => (
i
=> 'ro',
required => 0,
);
sub uri_manifest_json { return $_[0]->uri . '_manifest.json'; }
sub uri_details_json { return $_[0]->uri . '_full.json'; }
sub uri_details_xml { return $_[0]->uri . '
I.
=head1 INTERFACE
All of the methods defined here return hash reference which converted form JSON response.
As Net::Rexster::Client provides low level interface, please use Data::Dumper to check
use strict;
use Carp;
use Moose;
use LWP::UserAgent;
use Net::Rexster::Response;
use Encode;
use JSON;
use URI::Escape;
use utf8;
has 'ua' => (is => 'ro', isa => "LWP::UserAgent", default => sub { L
::Rexster::Response->new(content => {});
}
# Decode from JSON and utf8
return Net::Rexster::Response->new(content => JSON->new->utf8->decode(decode_utf8($response->content)));
}
1; # Ma
na::Request::VERSION = '0.003';
}
# ABSTRACT: Asana Request Class
use MooX qw(
+HTTP::Request
+JSON
+URI
+URI::QueryParam
);
has api_key => (
is => 'ro',
required => 1,
);
has to => (
is =>
uest { shift->_http_request }
has json => (
is => 'ro',
lazy => 1,
builder => 1,
);
sub _build_json {
my $json = JSON->new;
$json->allow_nonref;
return $json;
}
sub _build__http_request {
my
string;
if ($self->method ne 'GET') {
push @headers, ('Content-type', 'application/json');
$body = $self->json->encode({ data => $self->data });
} elsif (%data) {
warn 'Request includes %data
RITY = 'cpan:TOBYINK';
$XT::Util::VERSION = '0.001';
@EXPORT = qw/__CONFIG__/;
}
use JSON qw/from_json/;
use base qw/Exporter/;
sub __CONFIG__ (;$)
{
my ($package, $file) = caller(0);
$file
t;
$files{ $name } ||= do
{
(my $config_file = $name) =~ s{\.(PL|pl|pm|pmc|t)$}{};
from_json do {
open my $fh, '<', "$config_file\.config"
or return $files{$name} = +{};
local $
ill strip ".t" from
the end of the file name, add ".config", slurp the contents and parse them
as JSON, returning the result.
If C<< $testfile >> is omitted, then uses the caller's filename.
By movi