Group
Extension

Matches 35358

Plack-ResponseHelper ( K/KO/KOMAROV/Plack-ResponseHelper-0.05.tar.gz, KOMAROV, 2012; MetaCPAN )
Plack-ResponseHelper/lib/Plack/ResponseHelper.pm ( view source; MetaCPAN )
 it as a micro-framework:

in app.psgi

    use Plack::Request;
    use Plack::ResponseHelper json => 'JSON',
                              text => 'Text';

    my $app = sub {
        my $env = shift
$form);
    };

somewhere in your controllers

    sub my_controller {
        ...
        return json => {status => 'ok', data => [1, 2, 3]};
    }

    # or
    sub dummy_controller {
        return
s Plack's specifics.

Bundled with
L<Plack::ResponseHelper::Attachment>,
L<Plack::ResponseHelper::JSON>,
L<Plack::ResponseHelper::Redirect>,
L<Plack::ResponseHelper::Text>.

=head1 METHODS

=head2 use
jQuery-DataTables ( T/TO/TOKAR/jQuery-DataTables-0.906.tar.gz, TOKAR, 2012; MetaCPAN )
jQuery-DataTables/lib/jQuery/DataTables.pm ( view source; MetaCPAN )
d, col_int, col_text, col_real FROM datatable', [qw{id col_int col_text col_real}] );
$c->render( json => $res );

=cut

sub new {
	my $class = shift;
	my $self  = {};
	$self = {@_};

	die("Undefined 
WWW-Foursquare ( F/FX/FXZUZ/WWW-Foursquare-0.9906.tar.gz, FXZUZ, 2012; MetaCPAN )
WWW-Foursquare/lib/WWW/Foursquare/Response.pm ( view source; MetaCPAN )
package WWW::Foursquare::Response;

use strict;
use warnings;

use JSON;

our %ERROR_TYPE = (
    invalid_auth        => 'OAuth token was not provided or was invalid',
    param_error         => 'A re
elf, $class;
    return $self;
}

sub process {
    my ($self, $res) = @_;

    my $data = decode_json($res->content());
    my $code = $res->code();

    # response is OK
    return $data->{response}
MooseX-Storage ( B/BO/BOBTFISH/MooseX-Storage-0.32.tar.gz, BOBTFISH, 2012; MetaCPAN )
MooseX-Storage/lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm ( view source; MetaCPAN )
ad1 SYNOPSIS

  package Point;
  use Moose;
  use MooseX::Storage;
  
  with Storage('format' => 'JSON', 'io' => 'File');
  
  has 'x' => (is => 'rw', isa => 'Int');
  has 'y' => (is => 'rw', isa => '
MooseX-Storage ( B/BO/BOBTFISH/MooseX-Storage-0.32.tar.gz, BOBTFISH, 2012; MetaCPAN )
MooseX-Storage/lib/MooseX/Storage/Meta/Attribute/Trait/DoNotSerialize.pm ( view source; MetaCPAN )
ad1 SYNOPSIS

  package Point;
  use Moose;
  use MooseX::Storage;
  
  with Storage('format' => 'JSON', 'io' => 'File');
  
  has 'x' => (is => 'rw', isa => 'Int');
  has 'y' => (is => 'rw', isa => '
Catalyst-Runtime ( B/BO/BOBTFISH/Catalyst-Runtime-5.90019.tar.gz, JJNAPIORK, 2012; MetaCPAN )
Catalyst-Runtime/lib/Catalyst/ActionRole/ConsumesContent.pm ( view source; MetaCPAN )
=>'HashRef',
  builder=>'_build_normalized');


sub _build_normalized {
  return +{
    JSON => 'application/json',
    JS => 'application/javascript',
    PERL => 'application/perl',
    HTML => 'tex


    sub start : POST Chained('/') CaptureArg(0) { ... }

      sub is_json       : Chained('start') Consumes('application/json') { ... }
      sub is_urlencoded : Chained('start') Consumes('applicat
form-data') { ... }

      ## Alternatively, for common types...

      sub is_json       : Chained('start') Consume(JSON) { ... }
      sub is_urlencoded : Chained('start') Consumes(UrlEncoded) { ...
Catalyst-Runtime ( B/BO/BOBTFISH/Catalyst-Runtime-5.90019.tar.gz, JJNAPIORK, 2012; MetaCPAN )
Catalyst-Runtime/lib/Catalyst/UTF8.pod ( view source; MetaCPAN )
tempt to encode C<application/json> since the two most commonly used
approaches (L<Catalyst::View::JSON> and L<Catalyst::Action::REST>) have already configured
their JSON encoders to produce properly 
nses.  If you are rolling your
own JSON encoding, you may need to set the encoder to do the right thing (or override
the global regular expression to include the JSON media type).

=head2 Encoding wit
Catalyst-Runtime ( B/BO/BOBTFISH/Catalyst-Runtime-5.90019.tar.gz, BOBTFISH, 2012; MetaCPAN )
Catalyst-Runtime/lib/Catalyst/Component.pm ( view source; MetaCPAN )
on class, which we don't have an instance of, ewwwww
# Also, naughty modules like Catalyst::View::JSON try to write to _everything_,
# so spit a warning, ignore that (and try to do the right thing any
Net-HTTP-Spore ( F/FR/FRANCKC/Net-HTTP-Spore-0.05.tar.gz, FRANCKC, 2012; MetaCPAN )
Net-HTTP-Spore/lib/Net/HTTP/Spore/Middleware/Runtime.pm ( view source; MetaCPAN )
VERSION

version 0.05

=head1 SYNOPSIS

    my $client = Net::HTTP::Spore->new_from_spec('twitter.json');
    $client->enable('Runtime');

    my $result = $client->public_timeline;
    say "request e
MojoX-Dispatcher-Qooxdoo-Jsonrpc ( M/MB/MBP/MojoX-Dispatcher-Qooxdoo-Jsonrpc-0.89.tar.gz, MBP, 2012; MetaCPAN )
MojoX-Dispatcher-Qooxdoo-Jsonrpc/lib/Mojolicious/Plugin/QooxdooJsonrpc.pm ( view source; MetaCPAN )
package Mojolicious::Plugin::QooxdooJsonrpc;

use Mojo::Base 'Mojolicious::Plugin';
use File::Spec::Functions qw(splitdir updir catdir file_name_is_absolute);
use Cwd qw(abs_path);

our $VERSION = '0.
 available and compiles at startup time and not
# only on demand.
use MojoX::Dispatcher::Qooxdoo::Jsonrpc;

sub register {
    my ($self, $app, $conf) = @_;

    # Config
    $conf ||= {};
    my $roo
$conf->{services};
    my $path = $conf->{path} || 'jsonrpc';
    my $r = $app->routes;

    $r->route($root.$path)->to(
        controller  => 'Jsonrpc',
        action      => 'dispatch',
        na
Kossy ( K/KA/KAZEBURO/Kossy-0.13.tar.gz, KAZEBURO, 2012; MetaCPAN )
Kossy/lib/Kossy/Request.pm ( view source; MetaCPAN )
er::MultiPart'
);

my $json_parser = HTTP::Entity::Parser->new();
$json_parser->register(
    'application/x-www-form-urlencoded',
    'HTTP::Entity::Parser::UrlEncoded'
);
$json_parser->register(
   
t'
);
$json_parser->register(
    'application/json',
    'HTTP::Entity::Parser::JSON'
);

my $json_only_parser = HTTP::Entity::Parser->new();
$json_only_parser->register(
    'application/json',
    
'HTTP::Entity::Parser::JSON'
);

sub _build_request_body_parser {
    my $self = shift;
    if ( $self->env->{'kossy.request.parse_json_body'} ) {
        return $json_parser;
    }
    $default_parse
Kossy ( K/KA/KAZEBURO/Kossy-0.13.tar.gz, KAZEBURO, 2012; MetaCPAN )
Kossy/lib/Kossy/Connection.pm ( view source; MetaCPAN )
 (
    new => 1,
    rw => [qw/req res stash args tx debug json_serializer/]
);
use Kossy::Exception;

our $VERSION = '0.63';

# for IE7 JSON venularity.
# see http://www.atmarkit.co.jp/fcoding/articl
es/webapp/05/webapp05a.html
# Copy from Amon2::Plugin::Web::JSON => Fixed to escape only string parts
my %_ESCAPE = (
    '+' => '\\u002b', # do not eval as UTF-7
    '<' => '\\u003c', # do not eval a
   my $body = shift;
    $body =~ s!([+<>])!$_ESCAPE{$1}!g;
    return qq("$body");
}

sub escape_json {
    my $self = shift;
    my $body = shift;
    # escape only string parts
    $body =~ s/"((?:
App-Pocoirc ( H/HI/HINRIK/App-Pocoirc-0.47.tar.gz, HINRIK, 2012; MetaCPAN )
App-Pocoirc/lib/App/Pocoirc.pm ( view source; MetaCPAN )
 server: irc.perl.org
     nick:   hlagherf32fr

The configuration file is in L<YAML|YAML> or L<JSON|JSON> format. It consists
of a hash containing C<global_plugins>, C<local_plugins>, C<networks>, C<
Net-HTTP-Spore ( F/FR/FRANCKC/Net-HTTP-Spore-0.05.tar.gz, ATHREEF, 2012; MetaCPAN )
Net-HTTP-Spore/lib/Net/HTTP/Spore/Meta/Types.pm ( view source; MetaCPAN )
s;
use MooseX::Types -declare => [ qw(UriPath Boolean HTTPMethod JSONBoolean) ];
use MooseX::Types::Moose qw(Str Int Defined);
use JSON;

subtype UriPath,
    as Str,
    where { $_ =~ m!^/! },
    me
   as Int,
    where { $_ eq 1 || $_ eq 0 };

subtype JSONBoolean,
    as Defined,
    where { JSON::is_bool($_) };

coerce Boolean,
    from JSONBoolean,
      via { return int($_) ? 1 : 0 },
    fro
Net-HTTP-Spore ( F/FR/FRANCKC/Net-HTTP-Spore-0.05.tar.gz, FRANCKC, 2012; MetaCPAN )
Net-HTTP-Spore/lib/Net/HTTP/Spore/Middleware/LogDispatch.pm ( view source; MetaCPAN )
ilename  => 'logfile'
        )
    );

    my $client = Net::HTTP::Spore->new_from_spec('twitter.json');
    $client->enable( 'LogDispatch', logger => $log );

=head1 AUTHOR

franck cuny <franck@lumb
Net-DiffBot ( B/BS/BSM/Net-DiffBot-0.02.tar.gz, BSM, 2012; MetaCPAN )
Net-DiffBot/lib/Net/DiffBot.pm ( view source; MetaCPAN )
package Net::DiffBot;

use 5.006;
use strict;
use warnings;
use LWP::UserAgent;
use JSON::XS;
use URI::Escape qw(uri_escape);
use HTTP::Request;

my $endpoint_url = 'http://www.diffbot.com/api/article
  my $data;
        eval {
            $data = decode_json($response->content);
        };
        if ($@) {
            warn "ERROR decoding JSON response";
            return undef;
        }
      
  my $data;
        eval {
            $data = decode_json($response->content);
        };
        if ($@) {
            warn "ERROR decoding JSON response";
            return undef;
        }
      
Net-HTTP-Spore ( F/FR/FRANCKC/Net-HTTP-Spore-0.05.tar.gz, FRANCKC, 2012; MetaCPAN )
Net-HTTP-Spore/lib/Net/HTTP/Spore/Middleware/Mock.pm ( view source; MetaCPAN )
=> 'text/plain'], 'ok');
        }
    };

    my $client = Net::HTTP::Spore->new_from_spec('spec.json');
    $client->enable('Mock', tests => $mock_server);
    my $res = $client->my_rest_method();
 
Net-HTTP-Spore ( F/FR/FRANCKC/Net-HTTP-Spore-0.05.tar.gz, FRANCKC, 2012; MetaCPAN )
Net-HTTP-Spore/lib/Net/HTTP/Spore/Middleware/Redirection.pm ( view source; MetaCPAN )
VERSION

version 0.05

=head1 SYNOPSIS

    my $client = Net::HTTP::Spore->new_from_spec('twitter.json');
    $client->enable( 'Redirection', max_redirect => 2 );

    # or
    $client->enable( 'Redir
Kossy ( K/KA/KAZEBURO/Kossy-0.13.tar.gz, KAZEBURO, 2012; MetaCPAN )
Kossy/lib/Kossy.pm ( view source; MetaCPAN )
ss::Accessor::Lite (
    new => 1,
    rw => [qw/req res stash args tx debug/]
);
use JSON qw//;

my $_JSON = JSON->new()->ascii(1);

my %_ESCAPE = (
    '+' => '\\u002b', # do not eval as UTF-7
    '
body );
    $self->res;
}

sub render_json {
    my $self = shift;
    my $obj = shift;

    # defense from JSON hijacking
    # Copy from Amon2::Plugin::Web::JSON
    if ( !$self->req->header('X-Requ
elf->halt(403,"Your request is maybe JSON hijacking.\nIf you are not a attacker, please add 'X-Requested-With' header to each request.");
    }

    # for IE7 JSON venularity.
    # see http://www.atm
MooseX-Storage ( B/BO/BOBTFISH/MooseX-Storage-0.32.tar.gz, BOBTFISH, 2012; MetaCPAN )
MooseX-Storage/lib/MooseX/Storage/Deferred.pm ( view source; MetaCPAN )
ase JSON)

  # pack the class into a JSON string
  $p->freeze({ format => 'JSON' }); # { "__CLASS__" : "Point", "x" : 10, "y" : 10 }

  # pack the class into a JSON string using parameterized JSONpm r
> [ JSONpm => { json_opts => { pretty => 1 } } ] });

  # unpack the JSON string into a class
  my $p2 = Point->thaw(
      '{ "__CLASS__" : "Point", "x" : 10, "y" : 10 }',
      { format => 'JSON' }
ally use them (see the
SYNOPSIS for more info)

=head1 SUPPORTED FORMATS

=over 4

=item I<JSON>

=item I<JSONpm>

=item I<YAML>

=item I<Storable>

=back

=head1 SUPPORTED I/O

=over 4

=item I<File>

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