# RFC 2045, RFC 2046
'js' => 'text/javascript', # RFC 4329
'json' => 'application/json', # RFC 4627
'pdf' => 'application/pdf', # RFC 3778
'png
he following classes inherit directly from L<GX::Serializer>:
=over 4
=item * L<GX::Serializer::JSON>
=item * L<GX::Serializer::Storable>
=back
=head1 AUTHOR
JE<ouml>rg A. Uzarek E<lt>uzarek@run
0.0.1"
rport: 12345
auto: true
The configuration file is in L<YAML|YAML> or L<JSON|JSON> format. It consists
of a hash containing the options described in the above code example. Onl
~ m{^text/}
|| $self->worker->content_type
=~ m{^application/(atom|css|javascript|json|rss|xml)})
{
# text
$self->worker->response->decode;
print {$fh} $se
ts (as a hash ref) of:
=over 4
=item * format => $format
The valid format of the mssage, eithe JSON, YAML, XML, or HTML.
=item * content => $content
The decoded content from the HTTP response.
=
d $args{request_time};
if ( $args{format} eq "JSON" ) {
require JSON;
JSON->import('decode_json');
my $hash = decode_json( $args{content} );
$self->job_id( $hash->
k',
api => 'http://qik.com/api/oembed.json',
url => 'http://qik.com/*',
},
{
name => 'Vimeo',
api => 'http://vimeo.com/api/oembed.json',
url => 'http://(www.)vimeo.com/*',
api => 'http://www.hulu.com/api/oembed.json',
url => 'http://*hulu.com/watch/*',
},
{
name => 'PhotoBucket',
ordie.com/videos/*',
},
{
name => 'Pownce',
api => 'http://api.pownce.com/2.1/oembed.json',
url => 'http://*.pownce.com/*',
},
{
name => 'Poll Everywhere',
e datatype to be returned, default is xml.
$api->type('xml');
$api->type('yaml');
$api->type('json');
=item Movie_browse( %data )
C<< <http://api.themoviedb.org/2.1/methods/Movie.browse> >>
The
package Crashplan::Client::Org;
use strict;
use warnings;
use JSON;
our $VERSION = '0.003_0';
=head1 NAME
Crashplan::Client::Org - Object representation of Crashplan PROe server's entity
=head1 S
rent object
my @attributes = grep {!/^rest|rest_header$/} keys %$self;
my $body = encode_json( { map {$_ => $self->{$_}} @attributes} );
$self->{rest}->PUT($self->url."/".$self->id,$body
:
=over 4
=item * JSON
=item * XML
=item * YAML
=item * HTML
=back
=cut
sub format {
my $self = shift;
if (@_) {
my $new = shift;
if ( $new !~ /^JSON|XML|YAML|HTML$/ )
rp "Invalid format. Must be one of JSON, XML, YAML, or HTML.";
return;
}
$self->{format} = $new;
}
return $self->{format} || "JSON";
}
=item mime_type
This return
carp "format() needs to be set";
return;
}
return "application/json" if $self->format eq "JSON";
return "text/xml" if $self->format eq "XML";
return "application/
se '::Util::TypeConstraints';
use Text::Trim;
use Geo::Routing::Driver::OSRM::Route;
use JSON::XS qw(decode_json);
with qw(Geo::Routing::Role::Driver);
has osrm_path => (
is => 'ro',
qw(
json
xml
);
has query_method => (
is => 'ro',
isa => 'OSRMQueryMethod',
default => 'json',
documentation => "Should we make XML or JSON request
};
} elsif ($method eq 'json') {
my $json = decode_json($content);
return if $json->{status} eq '207';
my $route_summary = $json->{route_summary};
my ($dis
vice::Google::Closure::Response;
use Moose;
use MooseX::Types::Moose qw( ArrayRef Str Int );
use JSON;
use WebService::Google::Closure::Types qw( ArrayRefOfWarnings ArrayRefOfErrors Stats );
has fo
sa => Str,
trigger => sub { my $self = shift; die "Bad format - only json" unless $self->format eq 'json' },
);
has content => (
is => 'ro',
isa => Str,
trigg
rn 0;
}
return 1;
}
sub _set_content {
my $self = shift;
my $json = JSON->new();
my $content = $json->decode( $self->content );
foreach my $key ( keys %{ $content } ) {
package FeedHandler;
use parent qw(Tatsumaki::Handler);
__PACKAGE__->asynchronous(1);
use JSON;
sub get {
my($self, $query) = @_;
my $client = Tatsumaki::HTTPClient->new;
Tatsumaki::Error::HTTP->throw(500);
}
my $json = JSON::decode_json($res->content);
$self->write("Fetched " . scalar(@{$json->{entries}}) . " entries from API");
$self->finis
def,
);
has output_format => (
is => 'ro',
isa => Str,
default => 'json',
init_arg => undef,
);
has output_info => (
is => 'ro',
isa => Arr
r;
use strict;
use AnyEvent;
use Carp ();
use Encode ();
use Any::Moose;
use MIME::Base64 ();
use JSON;
use Tatsumaki::Error;
has application => (is => 'rw', isa => 'Tatsumaki::Application');
has con
=> (is => 'rw', isa => 'Str', lazy => 1, lazy_build => 1);
has json => (is => 'rw', isa => 'JSON', lazy => 1, default => sub { JSON->new->utf8 });
has binary => (is => 'rw', isa => 'Bool');
ha
$_[0]) {
if ($self->mxhr) {
my $json = $self->json->encode($_[0]);
return "Content-Type: application/json\n\n$json\n--" . $self->mxhr_boundary. "\n";
} else {
use MooseX::Types::Moose qw( ArrayRef HashRef Str Int Undef );
use Perl6::Junction qw( any );
use JSON;
use WebService::Google::Closure::Type::Warning;
use WebService::Google::Closure::Type::Error;
u
h 'Geo::Routing::Role::Query';
sub query_string {
my ($self, $method) = @_;
$method ||= "json";
my @atoms = qw(from_latitude from_longitude to_latitude to_longitude);
my $query_stri
is => 'rw', isa => 'Str', required => 0 );
# JSON boolean values, coerced into 1|0 (Not Required)
has [qw/ zone_deleted /]
=> ( is => 'ro', isa => 'json_bool', coerce => 1, required => 0 );
1;
struder::Server;
use common::sense;
use AnyEvent;
use AnyEvent::Handle;
use AnyEvent::Socket;
use JSON;
use Games::Construder::Protocol;
use Games::Construder::Server::Resources;
use Games::Construde
see <http://www.gnu.org/licenses/>.
#
package Games::Construder::Protocol;
use common::sense;
use JSON;
require Exporter;
use POSIX qw/floor/;
our @ISA = qw/Exporter/;
our @EXPORT = qw/
packet2dat
Games::Construder::Protocol - Client-Server Protocol Utility Functions
=over 4
=cut
my $JS = JSON->new;
sub packet2data {
my ($header, $body) = @_;
my $hdr_data = $JS->encode ($header);
ave_config;
} elsif ($hdr->{cmd} eq 'transfer_end') {
$self->{front}->msg;
#print JSON->new->pretty->encode ($self->{front}->{res}->{resource});
$self->{res}->post_proc;
ct