er_name - String value to uniquely identify a task in the ZooKeeper
cluster
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
er_name - String value to uniquely identify a task in the ZooKeeper
cluster
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
longing to the
cluster which execute the $cluster_name tasks.
Input:
- none
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
MATS->{html} = 'DAIA/HTML';
$FORMATS->{json} = 'DAIA/JSON';
$FORMATS->{xml} = 'DAIA/XML';
$FORMATS->{rdfjson} = 'DAIA/RDF (JSON)';
$FORMATS->{turtle} = 'DAIA/RDF (Turtl
fieldset(label('Input: ',
popup_menu('in',['','json','xml'],'',
{''=>'Guess','json'=>'DAIA/JSON','xml'=>'DAIA/XML'})
)).
fieldset('either', label('
b} } keys %$FORMATS ],
$outformat, $FORMATS )
), ' ',
label('JSONP Callback: ', textfield(-name=>'callback',-value=>$callback))
).
fieldset('<input typ
Test::More;
use Plack::App::DAIA::Test;
use Scalar::Util qw(reftype blessed);
use Test::JSON::Entails;
use JSON;
use Carp;
sub provedaia {
my ($suite, %args) = @_;
my $test = __PACKAGE__->
my $json = undef;
my %vars = ( server => $args{server} );
my @ids;
@ids = @{$args{ids}} if $args{ids};
my $run = sub {
my $server = $vars{server} or return;
$json ||=
my $test_json = $json;
$vars{id} = $id;
$test_json =~ s/\$([a-z]+)/defined $vars{$1} ? $vars{$1} : "\$$1"/emg;
$test_json = decode_json($test_json);
er_name - String value to uniquely identify a task in the ZooKeeper
cluster
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
MPRPC::Client instance
sub get_client {
my ($self) = @_;
return $self->{client};
}
# Get JSON configure data from Jubatus server
sub get_config {
my ($self) = @_;
my $retval = $self->
[],
[],);
return $retval;
}
# Get JSON status data from Jubatus server
sub get_status {
my ($self) = @_;
my $retval = $self->_ca
er_name - String value to uniquely identify a task in the ZooKeeper
cluster
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
er_name - String value to uniquely identify a task in the ZooKeeper
cluster
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
dAttributes;
use List::Util qw(first);
use List::MoreUtils ();
use Scalar::Util qw(blessed);
use JSON ();
use CatalystX::Controller::ExtJS::Direct::Route;
__PACKAGE__->config(
action => {
=> 'router' },
src => { Local => undef },
},
default => 'application/json'
);
has 'api' => ( is => 'rw', lazy_build => 1 );
has 'routes' => ( is => 'rw', isa => 'H
actions => $data
};
}
sub encoded_api {
my ( $self, $c ) = @_;
return JSON::encode_json( $self->set_namespace( $self->api, $c ? $c->req->params->{namespace} : () ) );
}
sub rout
},
accepted_content_types => ['application/json'],
content_types => ['application/json'],
content_type => 'application/json'
);
};
# split a request in multiple requests
$c->req->is_ext_upload )
{
unshift(@{$c->req->accepted_content_types}, 'application/json');
return 1;
}
else {
return $self->next::method( $controller, $c );
IO::Pool::Redis;
use strict;
use warnings;
use base 'PocketIO::Pool';
use AnyEvent::Redis;
use JSON;
use Scalar::Util qw(blessed);
use PocketIO::Connection;
use constant DEBUG => $ENV{POCKETIO_PO
self->{channel} => sub {
my ($message, $channel) = @_;
$message = decode_json($message);
my $invoker_id = $message->{invoker};
foreach my $conn ($sel
. $id . "'\n";
$cb->() if $cb;
}
sub send {
my $self = shift;
my $message = encode_json({message => "$_[0]"});
$self->{pub}->publish($self->{channel}, $message);
return $self;
use different session data.
package MyJediApp;
use Jedi::App;
use Jedi::Plugin::Session;
use JSON;
sub jedi_app {
my ($app) = @_;
$app->get('/set_session', sub {
my ($app, $request, $re
$request->session_get;
$response->status(200);
$response->body(defined $session ? encode_json($session) : 'session not defined !');
})
}
1;
=head1 LIMITATION
The session is keep in memo
$object) = $self->_prepare(@_);
return 0 unless defined $object && !ref $object;
# From JSON::PP
my $flags = B::svref_2object(\$object)->FLAGS;
my $is_number = $flags & (B::SVp_IOK |
se
L<List::Util> and L<List::MoreUtils> modules.
Numeric/String detection is done the same way L<JSON::PP> does it: by using
L<B> hacks.
Boolean values are implemented as overloaded methods, that re
CT: Sets the request method via a query parameter
use Moose::Role;
use namespace::autoclean;
use JSON::XS;
#has 'is_ext_upload' => ( isa => 'Bool', is => 'rw', lazy_build => 1 );
sub is_ext_upload
^multipart\/form-data/
&& ( !$self->{content_type} || $self->{content_type} ne 'application/json');
}
around 'method' => sub {
my ( $orig, $self, $method ) = @_;
return $self->$orig($me
;
BEGIN { extends 'Catalyst::Controller' };
with 'CatalystX::Controller::ExtJS::Direct';
use JSON::XS;
sub add : Chained('/') : Path : CaptureArgs(1) {
my($self,$c, $arg) = @_;
$c->stas
: DirectArgs(1) {
my ($self, $c) = @_;
$c->res->content_type('application/json');
$c->res->body(encode_json($c->req->data));
}
As you can see the C<add_to> action has the C<Direct> attri
which is always an arrayref and includes all arguments.
We set the content type to C<application/json> to make sure that the
body is not serialized twice. That is, if you would not set the content ty
ex/;
use Data::UUID;
use Path::Class;
use Jedi::Plugin::Auth::DB;
use DBIx::Class::Migration;
use JSON;
my $uuid_generator = Data::UUID->new;
# connect / create / prepare db
sub _prepare_database {
return {
user => $user->user,
uuid => $user->uuid,
info => decode_json( $user->info ),
roles => [ map { $_->name } $user->roles->all() ],
};
}
use Moo::Rol
),
uuid => $uuid_generator->create_str(),
info => encode_json( $params{info} ),
}
);
1;
};
$user->set_roles( [ map { {
use HTML::FormFu::ExtJS 0.076;
use Path::Class;
use HTML::Entities;
use Lingua::EN::Inflect;
use JSON;
use Try::Tiny;
use Moose::Util::TypeConstraints;
subtype 'PathClassDir', as 'Path::Class::Dir';
'stash_key'}
)
|| 'rest';
my $output;
eval { $output = encode_json( $c->stash->{$stash_key} ); };
$c->res->content_type('text/html');
$c->res->outp
({ ... });
1;
# set the Accept header to 'application/json' globally
Ext.Ajax.defaultHeaders = {
'Accept': 'application/json'
};
=head1 DESCRIPTION
This controller will make CRUD op
rp;
use Data::Dumper;
use JSON;
use Readonly;
use HTTP::Request;
use LWP::UserAgent;
our $VERSION = '0.05';
Readonly my $BASE_URL => "http://jobs.github.com/positions.json";
type 'TrueFalse' => wh
s available on https://jobs.github.com/api)
use strict;
use warnings;
use GitHub::Jobs;
use JSON::XS;
use POSIX;
$|++;
my $query = 'software';
my $count = 0;
my $pagination = 0;
;
my $str = GitHub::Jobs->new( description => $query, page => $page );
return JSON::XS::decode_json( $str->search() );
}
sub decode {
foreach my $items ( @{ initial($pagination) }