Group
Extension

Matches 35359

Plack-Middleware-JSONParser ( Y/YO/YOSUKEF/Plack-Middleware-JSONParser-0.02.tar.gz, YOSUKEF, 2014; MetaCPAN )
Plack-Middleware-JSONParser/lib/Plack/Middleware/JSONParser.pm ( view source; MetaCPAN )
package Plack::Middleware::JSONParser;
use strict;
use warnings;
use JSON;
use Hash::MultiValue;
use Plack::Request;

our $VERSION = "0.02";

use parent 'Plack::Middleware';

sub call {
    my ($self,
m{\Aapplication/json}o) {
        my $req = Plack::Request->new( $env );
        my $raw_body = $req->raw_body();
        return $self->app->($env) unless ($raw_body);
        my $json;
        {
    
     local $@;
          $json = eval { decode_json($raw_body) };
          if ($@) {
            die $@ if $self->{die_when_failed};
            $env->{'plack.middleware.jsonparser.error'} = $@;
    
Opsview-REST ( M/MR/MRUIZ/Opsview-REST-0.013.tar.gz, MRUIZ, 2014; MetaCPAN )
Opsview-REST/lib/Opsview/REST.pm ( view source; MetaCPAN )
$self = shift;
            require JSON;
            my $uri = Opsview::REST::Config->new(
                $obj_type,
                json_filter => JSON::encode_json({@_}),
            );
           
KiokuDB ( D/DO/DOY/KiokuDB-0.57.tar.gz, DOY, 2014; MetaCPAN )
KiokuDB/lib/KiokuDB/TypeMap/Default.pm ( view source; MetaCPAN )
DESCRIPTION

The default typemap is actually defined per backend, in
L<KiokuDB::TypeMap::Default::JSON> and L<KiokuDB::TypeMap::Default::Storable>.
The list of classes handled by both is the same, but
Net-Zemanta ( A/AV/AVIAN/Net-Zemanta-0.7.tar.gz, AVIAN, 2014; MetaCPAN )
Net-Zemanta/lib/Net/Zemanta/Method.pm ( view source; MetaCPAN )
ethod;

use warnings;
use strict;

use LWP::UserAgent;
use HTTP::Request::Common;
use Encode;
use JSON;

our $VERSION = '0.7';

my $SERVICE_TYPE = "rest";
my $API_VERSION = "0.0";

my $UA_SUFFIX = "Pe
shift;
	my %params = @_;

	my %merged_params = ( 	'method'  => $self->{METHOD},
				'format'  => 'json',
				'api_key' => $self->{APIKEY},
				%params );

	my $response = $self->{ua}->request(POST $se
->is_success) {
		$self->{error} = $response->status_line;
		return undef;
	}

	my $result = from_json($response->content);

	if ($result->{status} ne 'ok') {
		$self->{error} = "method returned " . $
KiokuDB ( D/DO/DOY/KiokuDB-0.57.tar.gz, DOY, 2014; MetaCPAN )
KiokuDB/lib/KiokuDB/Tutorial.pod ( view source; MetaCPAN )
a associated with it.

Since the default serializer for the DBI backend is
L<KiokuDB::Serializer::JSON>, we examine the data.

First let's set C<sqlite>'s output mode to C<line>. This is easier to rea
"id":"05A8D61C-6139-4F51-A748-101010CC8B02","root":true}

You'll notice the C<spouse> field has a JSON object with a C<$ref> field inside
it holding the UUID of the target object.

When data is loaded
Dancer-Plugin-REST ( Y/YA/YANICK/Dancer-Plugin-REST-0.11.tar.gz, YANICK, 2014; MetaCPAN )
Dancer-Plugin-REST/lib/Dancer/Plugin/REST.pm ( view source; MetaCPAN )

use Carp 'croak';
use Dancer ':syntax';
use Dancer::Plugin;

my $content_types = {
    json => 'application/json',
    yml  => 'text/x-yaml',
    xml  => 'application/xml',
};

our $default_serialize
(
        ($conf && exists $conf->{serializers})
        ? $conf->{serializers}
        : { 'json' => 'JSON',
            'yml'  => 'YAML',
            'xml'  => 'XML',
            'dump' => 'Dumper',
format' => sub {
        User->find(params->{id});
    };

    # curl http://mywebservice/user/42.json
    { "id": 42, "name": "John Foo", email: "john.foo@example.com"}

    # curl http://mywebservic
Form-Toolkit ( J/JE/JETEVE/Form-Toolkit-0.008.tar.gz, JETEVE, 2014; MetaCPAN )
Form-Toolkit/lib/Form/Toolkit/Form.pm ( view source; MetaCPAN )
use Form::Toolkit::Clerk::Hash;

use Form::Toolkit::Field;
use Form::Toolkit::Field::String;

use JSON;
use MIME::Base64;
use Scalar::Util;


with qw(MooseX::Clone);

=head1 NAME

Form::Toolkit::Form 
 for Form implementation

=cut

__PACKAGE__->meta->id_prefix('form_');

has 'jsoner' => ( isa => 'JSON' , is => 'ro', required => 1, lazy_build => 1);

has 'fields' => ( isa => 'ArrayRef[Form::Toolkit
lds

=cut

sub BUILD{
  my ($self) = @_;
  $self->build_fields();
}

sub _build_jsoner{
  my ($self) = @_;
  return JSON->new->ascii(1)->pretty(0);
}


=head2 fast_clone

Returns fast clone of this fo
Mojolicious-Plugin-DirectoryQueue ( F/FU/FUKAI/Mojolicious-Plugin-DirectoryQueue-0.01.tar.gz, FUKAI, 2014; MetaCPAN )
Mojolicious-Plugin-DirectoryQueue/lib/Mojolicious/Plugin/DirectoryQueue.pm ( view source; MetaCPAN )
ojolicious::Plugin::DirectoryQueue;

use Mojo::Base 'Mojolicious::Plugin';
use Mojo::JSON qw(decode_json encode_json);
use Directory::Queue;
use POSIX qw(chown);

our $VERSION = '0.01';


sub register
elper(
        enqueue => sub {
            my ($self, $args) = @_;
            $dirq->add(encode_json($args));
        },
    );

    $app->helper(
        dequeue => sub {
            for (my $name 
  my $data = $dirq->get($name);
               $dirq->remove($name);
               return decode_json($data) if $data;
            }
            return;
        },
    );

    $app->helper(
        s
KiokuDB ( D/DO/DOY/KiokuDB-0.57.tar.gz, DOY, 2014; MetaCPAN )
KiokuDB/lib/KiokuDB/Serializer.pm ( view source; MetaCPAN )
rom_stream";

my %types = (
    storable => "KiokuDB::Serializer::Storable",
    json     => "KiokuDB::Serializer::JSON",
    yaml     => "KiokuDB::Serializer::YAML",
);

coerce( __PACKAGE__,
    from
KiokuDB ( D/DO/DOY/KiokuDB-0.57.tar.gz, DOY, 2014; MetaCPAN )
KiokuDB/lib/KiokuDB/Entry.pm ( view source; MetaCPAN )
ta structure modeling this object/reference. This is a tree, not
a graph, and has no shared data (JSON compliant). All references are symbolic,
using a L<KiokuDB::Reference> object with UIDs as the
ad
Pistachio ( J/JB/JBD/Pistachio-0.10.tar.gz, JBD, 2014; MetaCPAN )
Pistachio/lib/Pistachio.pm ( view source; MetaCPAN )
okenized JSON

Using modules:

=over

=item *

L<Pistachio::Language> 

=item *

L<https://github.com/joeldalley/lib-JBD> (JBD::JSON).

=back

In this example, JBD::JSON is used to parse JSON text int
n types JBD::JSON produces to CSS definitions.

 use strict;
 use warnings;

 use Pistachio;
 use Pistachio::Token;
 use Pistachio::Language;
 use JBD::JSON 'std_parse';

 # Argument: JSON input text.
 Returns arrayref of Pistachio::Tokens.
 my $tokens = sub {
     my $tokens = std_parse 'json_text', $_[0];
     [map Pistachio::Token->new($_->type, $_->value), @$tokens];
 };

 # Argument: a token t
KiokuDB ( D/DO/DOY/KiokuDB-0.57.tar.gz, DOY, 2014; MetaCPAN )
KiokuDB/lib/KiokuDB/Backend/Serialize.pm ( view source; MetaCPAN )
eserialize);

my %types = (
    storable => "KiokuDB::Serializer::Storable",
    json     => "KiokuDB::Serializer::JSON",
    yaml     => "KiokuDB::Serializer::YAML",
    memory   => "KiokuDB::Seriali
nd::Serialize::Storable>,
L<KiokuDB::Backend::Serialize::YAML> and L<KiokuDB::Backend::Serialize::JSON>
for examples.

=head1 REQUIRED METHODS

=over 4

=item serializate $entry

Takes a L<KiokuDB::En
Form-Toolkit ( J/JE/JETEVE/Form-Toolkit-0.008.tar.gz, JETEVE, 2014; MetaCPAN )
Form-Toolkit/lib/Form/Toolkit/Clerk.pm ( view source; MetaCPAN )
rk;
{
  $Form::Toolkit::Clerk::VERSION = '0.008';
}
use Moose;
use DateTime::Format::ISO8601;
use JSON;

has 'source' => ( required => 1 , is => 'ro' );

has '_date_parser' => ( is => 'ro' , default =
KiokuDB ( D/DO/DOY/KiokuDB-0.57.tar.gz, DOY, 2014; MetaCPAN )
KiokuDB/lib/KiokuDB/Util.pm ( view source; MetaCPAN )
ouchdb" => "CouchDB",
    "mongodb" => "MongoDB",
);

sub _try_json {
    my $json = shift;

    require JSON;
    JSON->new->decode($json);
}

sub dsn_to_backend {
    my ( $dsn, @args ) = @_;

    i
d_class($class);
        return $class->new_from_dsn($rest, @args);
    } elsif ( my $args = _try_json($dsn) ) {
        my $dsn;

        if ( ref $args eq 'ARRAY' ) {
            ( $dsn, $args ) = @
Business-YQL ( A/AA/AANARI/Business-YQL-0.0004.tar.gz, AANARI, 2014; MetaCPAN )
Business-YQL/lib/Business/YQL.pm ( view source; MetaCPAN )
TP::Request::Common qw(GET POST);
use URI;
use URI::QueryParam;
use LWP::UserAgent;
use JSON qw(to_json from_json);
use Carp qw(croak);
use Log::Any qw($log);
use Try::Tiny;

has scheme  => (is => 'ro
(
        q           => $query,
        format      => 'json',
        env         => 'store://datatables.org/alltableswithkeys',
        jsonCompat  => 'new',
    );

    my $uri = URI->new($self->u
  $res = $self->ua->request($req);
    }
    return from_json $res->content
        if $res->code =~ /^4/x;
    return $res->content ? from_json($res->content)->{query}{results} : 1;
}

sub _log_conte
KiokuDB ( D/DO/DOY/KiokuDB-0.57.tar.gz, DOY, 2014; MetaCPAN )
KiokuDB/lib/KiokuDB.pm ( view source; MetaCPAN )
 a simplified representation of the object, allowing the data to be
saved in formats as simple as JSON.

References to other objects are converted to symbolic references in the entry,
so objects can b
to pass it in:

    KiokuDB->connect( $dsn, typemap => $typemap );

The DSN can also be a valid L<JSON> string taking one of the following forms:

    dsn => '["dbi:SQLite:foo",{"schema":"MyApp::DB"}]
AnyEvent-LeapMotion ( A/AK/AKIYM/AnyEvent-LeapMotion-0.01.tar.gz, AKIYM, 2014; MetaCPAN )
AnyEvent-LeapMotion/lib/AnyEvent/LeapMotion.pm ( view source; MetaCPAN )
otion;
use 5.008005;
use strict;
use warnings;
use AnyEvent::Handle;
use AnyEvent::Socket ();
use JSON ();
use Protocol::WebSocket;
use Protocol::WebSocket::Frame;
use Protocol::WebSocket::Handshake::
         if (my $message = $self->{frame}->next_bytes) {
                        my $data = JSON::decode_json($message);
                        if (exists $data->{id} && exists $data->{timestamp}) {
         });
        });
    };
}

sub send {
    my ($self, $data) = @_;
    my $message = JSON::encode_json($data);
    my $frame = Protocol::WebSocket::Frame->new($message);
    $self->{handle}->pu
Bio-BioVeL ( R/RV/RVOSA/Bio-BioVeL-0.1.tar.gz, RVOSA, 2014; MetaCPAN )
Bio-BioVeL/lib/Bio/BioVeL/Service/NeXMLMerger.pm ( view source; MetaCPAN )
l or as URL
 	'-dataformat'    => 'nexus',
 	'-treeformat'    => 'newick',
 	'-metaformat'    => 'json',
 	'-charsetformat' => 'nexus',
 );

 my $merger = Bio::BioVeL::Service::NeXMLMerger->new;
 my $
Net-DNSbed ( Y/YH/YHPENG/Net-DNSbed-0.02.tgz, YHPENG, 2014; MetaCPAN )
Net-DNSbed/lib/Net/DNSbed.pm ( view source; MetaCPAN )
package Net::DNSbed;

use 5.006;
use warnings;
use strict;
use Carp qw/croak/;
use JSON;
use LWP::UserAgent;

use vars qw/$VERSION/;
$VERSION = '0.02';

sub new {
    my $class = shift;
    my $uid = 
form-urlencoded');
    $req->content($args);

    my $res = $ua->request($req);
    return decode_json($res->decoded_content);
}


1;


=head1 NAME

Net::DNSbed - Perl client for DNSbed API

=head1 VE
Task-BeLike-TOKUHIROM ( T/TO/TOKUHIROM/Task-BeLike-TOKUHIROM-0.02.tar.gz, TOKUHIROM, 2014; MetaCPAN )
Task-BeLike-TOKUHIROM/lib/Task/BeLike/TOKUHIROM.pm ( view source; MetaCPAN )
See also L<Coro>.

=back

=head2 JSON

=over 4

=item L<JSON::XS>

JSON::XS is pretty fast. I'm use this for the point what needs performance.

=item L<JSON::PP>

JSON::PP is written in pure perl. And

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.