plate controller> is an entry point into Camel-PKI : it consists
of the code that responds to the JSON-RPC requests for issuing or
revoking certificates. Other user-initiated Certification Authority
d2 certifyJSON($reqdetails) : Local : ActionClass("+App::CamelPKI::Action::JSON")
Requests the issuance of a number of certificates in this template
family. $reqdetails (passed as the JSON-RPC POST
the same call to
I<certify> throws an exception.
The response is transmitted as an C<application/json> HTTP document,
with the following structure (again in Perl syntax):
{
keys => [
tem *
L<DBIx::Class::Schema::Loader>
=item *
L<Catalyst::View::TT>
=item *
L<Catalyst::View::JSON>
=item *
L<Catalyst::Model::DBIC::Schema>
=item *
L<Catalyst::Model::DBIC::File>
=item *
L<
package P2P::Transmission::Remote;
use strict;
use 5.8.1;
our $VERSION = '0.02';
use Carp;
use JSON::XS;
use LWP::UserAgent;
use URI;
use Moose;
use Moose::Util::TypeConstraints;
subtype 'Uri'
Accept => "application/json, text/javascript, */*" );
$req->header( "Content-Type" => "application/json" );
$self->_prepare_auth;
my $body = JSON::XS::encode_json({
method => $m
;
my $ua = $self->user_agent;
my $res = $ua->request( $req );
my $result = JSON::XS::decode_json( $res->content );
if ($result->{result} ne 'success') {
croak $result->{res
ter::SOAP;
use POE::Component::Server::AsyncEndpoint::ChannelAdapter::Config;
use JSON; #optional
sub new {
my $class = shift;
# Init the new class w
STC};
unless ( $call->fault ) {
# Sample use of JSON Serialization
# (why JSON? see POE::Component::Server::AsyncEndpoint)
my $retval = fro
} ) {
$self->{fifo_id} = $fifo_id;
$self->{data} = from_json( $retval->{params} );
# publish the data on the MQ, and ask for RECEIPT
and an unnecessary complication. The use of simple
and universal serialization languages, such as JSON, is a great
alternative for many interfaces. Of course, you use still have to use
XML B<to define
d for the SOAP envelope), but the actual
data (the "message parts" in WSDL) are just XSD::string (JSON encoded
strings) that carry associative arrays and perhaps even simple
objects. All our examples
t::Server::SNMP>
L<POE::Component::Client::SOAP>
L<POE::Component::Client::Stomp>
L<SOAP::Lite>
L<JSON>
=head1 AUTHOR
Alejandro Imass <ait@p2ee.org>
Alejandro Imass <aimass@corcaribe.com>
=head1 CO
code;
$msg .= " $extra" if $extra;
return $msg;
}
# TODO: implement
sub as_xml {}
sub as_json {}
# define exceptions here
use Exception::Class (
'Activator::Exception' => {
desc
attempt to load find and load a configuration
file of various types. Currently it supports YAML, JSON, XML,
INI and Perl formats. Special configuration for a particular driver format can
be stored in
my ( $self, $sprocket, $con, $socket ) = @_;
$con->filter->push(
POE::Filter::JSON->new( delimiter => 0, allow_nonref => 1 ) );
};
after remote_connected => sub {
use JSON;
use Data::Dumper;
my $q = new CGI;
print $q->header();
my $val = $q->param('args');
my @vals = split(//, $val);
my $hash;
map { $hash->{$_} = chr(ord($_)+1) } @vals;
my $json = ob
jToJson($hash);
print "var jsonObj = $json";
<title>CGI::Ajax JSON Example</title>
<script>
handle_return = function(vv){
document.getElementById('object_display').innerHTML = vv;
eval(vv); // this gives you 'var jsonObj' here in jav
/ alert(jsonObj);
var div = document.getElementById('parsed');
div.innerHTML = "</b>key : value<b><br/>";
for(var key in jsonObj){
div.innerHTML += key + " => " + jsonObj[key] +
you Enter </H2>
<form>
Enter Number:
<input type="text" id="val1" size="6" value='abc' onkeyup="json(['val1'], [handle_return]);">
<br/><br/>The JavaScript Object:<br/>
<div id="object_display" styl
N::Indexer::Mirror;
=pod
=head1 NAME
CPAN::Indexer::Mirror - Creates the mirror.yml and mirror.json files
=head1 SYNOPSIS
use CPAN::Indexer::Mirror ();
CPAN::Indexer::Mirror->new(
ro
SE indexer which generates F<mirror.yml> and F<mirror.json>.
These files are used to allow CPAN clients (via the L<Mirror::YAML> or
L<Mirror::JSON> modules) to implement mirror validation and automat
e File::Spec ();
use File::Remove ();
use YAML::Tiny ();
use JSON ();
use URI ();
use URI::http ();
use IO::At
equest->new($r, $db, @vars);
my $method = lc $r->method();
my $mime_type = 'application/json';
if ($method =~ m/^get|post|put|delete$/) {
if ($method eq 'get') {
my
=head1 VERSION
0.0.4
=head1 LIMITATIONS
Currently the only supported mime-type is application/json.
=head1 SEE ALSO
L<Sleep::Handler|Sleep::Handler>, L<Sleep::Resource|Sleep::Resource>,
L<Sleep:
package Sleep::Request;
use strict;
use warnings;
use JSON::XS;
sub new {
my $klass = shift;
my $request = shift;
my $db = shift;
my @vars = @_;
my $self = bless { re
rs}->[0];
}
sub decode {
my $self = shift;
my $data = shift;
$self->{data} = decode_json($data);
return;
}
sub data {
my $self = shift;
return $self->{data};
}
1;
__END__
DS
=over 4
=item id
Returns the first variable from C<vars>.
=item decode($data)
Parses the JSON data in C<$data> to a perl representation. Retrieve this value using C<data>.
=item data
Return
package Sleep::Response;
use strict;
use warnings;
use Carp;
use JSON::XS;
sub new {
my $klass = shift;
my $args = shift || {};
my $self = bless { %$args }, $klass;
return $self;
ub encode {
my $self = shift;
my $as = shift;
if ($as eq 'application/json') {
return encode_json($self->data());
}
croak "Can't encode";
}
1;
__END__
=head1 NAME
r at '$uri'";
return;
}
my $json = $res->decoded_content();
# Build up response
my @uris;
while (
$json =~ m{
"page_url" \s*:\s*
e ($json =~ m{ )
@uris = reverse sort @uris;
# Prepare for next iteration
($year, $month) = (); # exhausted by default
if (@uris
&& (my ($previous) = $json =~
woutputformats
Prints all the possible format for output
=item --showformats=(xml|json)
=item --showdef=[xml|json]
report all possible input/ouput format + relative info (optional/compulsory argue
package XiaoI;
use 5.008005;
use strict;
use warnings;
use JSON;
require Exporter;
our @ISA = qw(Exporter);
our $VERSION = '0.03';
# Preloaded methods go here.
use LWP::UserAgent;
if ($text =~ m{processMessageReceived\((.*)\)}s) {
my $json_text = $1;
my $ra = JSON->new->utf8(0)->decode($json_text);
if (@$ra > 0 and $ra->[0]->{CMD} eq 'CHAT') {
fox/addon/5712>
=item *
ExportReader: A Firefox extension to dump entries from Google Reader to JSON:
L<http://svn.openfoundry.org/xulapp/trunk/demo/ExportReader/>
This extension only costed me ab
you'll see an alert dialog saying how many entries were found. Click "OK" then the corresponding JSON string will be in the right-most textbox which is ready for copy-and-paste.
Note that, by defaul
detach( 'search', [ $distname ] );
}
$c->stash->{dist} = $dist;
return $dist;
}
sub json : Local Args(1) {
my ($self,$c,$distname) = @_;
$c->forward('get_dist',[ $distname ]);
}
# FIXME