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
.. do some stuff to decide if you are supposed to even hit fb ...
# hypothetically encoded as JSON and parsed by client app
return {redirect => fb_redirect_url};
};
get '/auth/facebook/po
use JSON;
my $foo = bless { handle => \*STDIN }, 'SomeObj';
print encode_json abridge_recursive( $foo );
local $DATA::Abridge::HONOR_STRINGIFY = undef;
print encode_json abridg
he bridegroom
This module exists to simplify the process of serializing data to formats, such as
JSON, which do not support the full richness of perl datatypes.
An abridged data structure will featu
ndef'},
=> sub { die "I don't know what $_ is" }
);
}
Or a simple JSON serializer:
sub to_json {
my $x = shift;
match_on_type $x => (
HashRef => sub {
. (
join ", " =>
map { '"' . $_ . '" : ' . to_json( $hash->{$_} ) }
sort keys %$hash
) . ' }';
},
o_json($_) } @$array ) . ' ]';
},
Num => sub {$_},
Str => sub { '"' . $_ . '"' },
Undef => sub {'null'},
=> sub { die "$_ is not acceptable json t
et_indexer( 'WebService::Dezi', { server => 'http://localhost:5000', content_type => 'application/json' } );
__PACKAGE__->table('person');
__PACKAGE__->add_columns(
person_id
TTRIBUTES
=head2 as_document( $self, $object )
Handles the insert operation. Generates a XML or JSON document
that will be indexed by the dezi service.
=cut
sub as_document {
my ( $self, $obj
Name=>'doc',);
} elsif ( $self->content_type eq 'application/json' ) {
require JSON;
$output_str = JSON::encode_json({ doc => $fields });
}
return $output_str;
}
__PACKAG
L<WWW::ASN::Standard> object, it has to fetch two
documents, the "details" xml and the "manifest" json.
Ideally this would get everything from the "details" document. We use both though, since it's
all of the Moose extensions you use will continue to work.
The other part is that Moose's C<META.json> file will also specify the
conflicts under the C<x_conflicts> key. We are working with the Perl
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
ge App::MetaCPAN::Gtk2::Notify;
use 5.006;
use strict;
use warnings;
our $VERSION = '0.05';
use JSON;
use LWP::UserAgent;
use Gtk2::Notify;
use File::Temp ();
use File::Spec;
use File::Slurp qw(writ
HODS
=cut
my $search_url = 'http://api.metacpan.org/v0/release/_search';
my $post_data = JSON::encode_json(
{
'size' => 20,
'from' => 0,
'sort' => [ { 'date' => { 'order
ost( $search_url, Content => $post_data );
if ( $resp->is_success ) {
my $res = JSON::decode_json( $resp->content );
return map { $_->{fields} } @{ $res->{hits}{hits} };
}
uire LWP::Simple; 1';
my $json_any = eval 'use JSON::Any; 1';
my $changes_parser = eval 'require CPAN::Changes; 1';
my $can_do_requests = $lwp_useragent && $json_any;
my $can_parse_chang
_author {
my $arg = shift;
my $json = LWP::Simple::get(sprintf $module_search, $arg) or return;
my $response = eval { JSON::Any->from_json($json) } or return;
if($response->{stat
$arg =~ s/::/-/g;
my $json = LWP::Simple::get(sprintf $changelog_search, $arg, $ver_stop) or return;
my $response = eval { JSON::Any->from_json($json) } or return;
my $first_hi
v dotvars find_code_dir path_for >],};
our $main_file_path = '/home/dotcloud/environment.json';
our $main_dotcloud_code_dir = '/home/dotcloud/code';
my @application_keys = qw< environment pro
\%retval;
} ## end sub _serialize_multiple
sub as_json {
my $self = shift;
require JSON;
return $self->_serialize_multiple(\&JSON::to_json, @_);
}
sub as_yaml {
my $self = shift;
req
or croak 'no suitable environment found';
if ($env =~ /\A \s* {/mxs) {
$self->merge_json($env);
}
else {
$self->merge_yaml($env);
}
return $self;
} ## end sub load
sub
apcli - SOAP client for CLI with YAML and JSON input
=head1 SYNOPSIS
B<soapcli>
S<[--verbose|-v]>
S<[--dump-xml-request|-x]>
data.yml|data.json|{string:"JSON"}|-
[webservice.wsdl|webservice_wsdl.url
SOAP client which accepts YAML or JSON document as
an input data.
The first argument is a request data as a JSON string or a name of file which
contains data in JSON or YAML format.
The second argum
= '0.001';
}
use MooseX::App::Command;
use 5.010;
use POSIX qw(strftime);
use HTTP::Request;
use JSON;
use TryCatch;
use WebService::Amazon::Glacier::GlacierError;
extends qw(WebService::Amazon::Glac
= '0.001';
}
use MooseX::App::Command;
use 5.010;
use POSIX qw(strftime);
use HTTP::Request;
use JSON;
use TryCatch;
use WebService::Amazon::Glacier::GlacierError;
extends qw(WebService::Amazon::Glac
as Perl itself.
package Authen::SASL::Perl::XOAUTH2 2.1900;
use strict;
use vars qw(@ISA);
use JSON::PP;
@ISA = qw(Authen::SASL::Perl);
my %secflags = (
noanonymous => 1,
);
sub _order {
rn $auth_string
}
sub client_step {
my ($self, $challenge) = @_;
my $json = JSON::PP->new;
my $payload = $json->decode( $challenge );
$self->set_error( $payload );
# Send dummy re
= '0.001';
}
use MooseX::App::Command;
use 5.010;
use POSIX qw(strftime);
use HTTP::Request;
use JSON;
use TryCatch;
use WebService::Amazon::Glacier::GlacierError;
extends qw(WebService::Amazon::Glac
Completed()){
push @{$request->{'Events'}}, 'InventoryRetrievalCompleted';
}
say(encode_json($request));
my $hr=HTTP::Request->new('PUT',"https://glacier.".$self->get_region().".ama
me(time())) ,
'x-amz-glacier-version', '2012-06-01',
]);
$hr->content(encode_json($request));
my $response=$self->_submit_request($hr);
if ($response->is_success) {
ret
ddress
Exception::Class
HTML::Entities
HTML::Tagset
HTML::Template
Iterator
Iterator::Util
JSON
Locale::Maketext::Lexicon
Mail::Sender
Net::IP
Net::LDAPS
PadWalker
PHP::Serialization
Pod
for talking to restful web services
use strict;
use warnings;
use LWP::UserAgent;
use URI;
use JSON::XS;
use HTTP::Request;
use HTTP::Headers;
use File::Path qw( mkpath );
use REST::Consumer::Reque
file_path {
my ($uri) = @_;
my $cache_filename = $uri->host . '-' . $uri->port . $uri->path . '.json';
# $cache_filename =~ s/\//-/g;
my ($dir, $filename) = $cache_filename =~ /(.*)\/([^\/]*)/i;
r
e "Couldn't open config file '$path': $!";
my $data = <$config_fh>;
my $decoded_data = JSON::XS::decode_json($data);
close $config_fh;
return $decoded_data;
}
sub write_config_to_file {
my ($ur
= '0.001';
}
use MooseX::App::Command;
use 5.010;
use POSIX qw(strftime);
use HTTP::Request;
use JSON;
use TryCatch;
use WebService::Amazon::Glacier::GlacierError;
extends qw(WebService::Amazon::Glac
= '0.001';
}
use MooseX::App::Command;
use 5.010;
use POSIX qw(strftime);
use HTTP::Request;
use JSON;
use TryCatch;
use WebService::Amazon::Glacier::GlacierError;
extends qw(WebService::Amazon::Glac