Group
Extension

Matches 35358

SockJS ( V/VT/VTI/SockJS-0.10.tar.gz, VTI, 2018; MetaCPAN )
SockJS/lib/SockJS/Transport/JSONPSend.pm ( view source; MetaCPAN )
package SockJS::Transport::JSONPSend;

use strict;
use warnings;

use base 'SockJS::Transport::Base';

use JSON ();

sub new {
    my $self = shift->SUPER::new(@_);

    push @{$self->{allowed_methods
q 'ARRAY';

    my $json = JSON->new->utf8->allow_nonref(0);

    my $message;
    eval { $message = $json->decode($data) } || do {
        return $self->_return_error('Broken JSON encoding.');
    };
CloudHealth-API ( J/JL/JLMARTIN/CloudHealth-API-0.01.tar.gz, JLMARTIN, 2018; MetaCPAN )
CloudHealth-API/lib/CloudHealth/API/CallObjectFormer.pm ( view source; MetaCPAN )
:Tiny;
  use JSON::MaybeXS;
  use Module::Runtime qw/require_module/;
  use CloudHealth::API::Error;
  use CloudHealth::API::HTTPRequest;

  has _json => (is => 'ro', default => sub { JSON::MaybeXS->n
(defined $body_struct) ? ('Content-Type' => 'application/json') : (),
      Accept => 'application/json',
    });
    $req->content($self->_json->encode($body_struct)) if (defined $body_struct);

    
SockJS ( V/VT/VTI/SockJS-0.10.tar.gz, VTI, 2018; MetaCPAN )
SockJS/lib/SockJS/Transport/WebSocket.pm ( view source; MetaCPAN )
use warnings;

use base 'SockJS::Transport::Base';

use Encode ();
use IO::Compress::Deflate;
use JSON ();
use AnyEvent::Handle;
use Protocol::WebSocket::Handshake::Server;

sub new {
    my $self = s
eq 'websocket') {
            my $json = JSON->new->utf8->allow_nonref(0);

            eval { $message = $json->decode($message) } || do {
                #warn "JSON error: $@\n";
                re
SockJS ( V/VT/VTI/SockJS-0.10.tar.gz, VTI, 2018; MetaCPAN )
SockJS/lib/SockJS/Transport/XHRSend.pm ( view source; MetaCPAN )
 SockJS::Transport::XHRSend;

use strict;
use warnings;

use base 'SockJS::Transport::Base';

use JSON ();

sub new {
    my $self = shift->SUPER::new(@_);

    push @{$self->{allowed_methods}}, 'POST
gth $data;

    my $json = JSON->new->utf8->allow_nonref(0);

    my $message;
    eval { $message = $json->decode($data) } || do {
        return $self->_return_error('Broken JSON encoding.');
    };
WWW-FCM-HTTP ( X/XA/XAICRON/WWW-FCM-HTTP-0.03.tar.gz, XAICRON, 2018; MetaCPAN )
WWW-FCM-HTTP/lib/WWW/FCM/HTTP/Response.pm ( view source; MetaCPAN )
package WWW::FCM::HTTP::Response;

use strict;
use warnings;
use JSON qw(decode_json);
use Class::Accessor::Lite (
    new => 0,
    ro  => [qw/http_response content is_success sent_reg_ids/],
);

use
->content;
    my $req_content = decode_json($http_response->request->content);

    my $sent_reg_ids = [];
    if ($is_success) {
        $content = decode_json $content;

        if (exists $content
MODS-Record ( H/HO/HOCHSTEN/MODS-Record-0.13.tar.gz, HOCHSTEN, 2018; MetaCPAN )
MODS-Record/lib/MODS/Record.pm ( view source; MetaCPAN )
alize
 print $mods->as_json(pretty => 1);
 print $mods->as_xml;

 # Deserialize
 my $mods = MODS::Record->from_xml(IO::File->new('mods.xml'));
 my $mods = MODS::Record->from_json(IO::File->new('mods.j
:File->new('mods.xml'), sub {
    my $mods = shift;
    ...
 });

 my $count = MODS::Record->from_json(IO::File->new('mods.js'), sub {
    my $mods = shift;
    ...
 });

=head1 DESCRIPTION

This modu
$callback])

Parse an XML string or IO::Handle into a MODS::Record. This method return the parsed JSON.

If a callback function is provided then for each MODS element in the XML stream the callback wi
DBIx-Class-EasyFixture ( O/OV/OVID/DBIx-Class-EasyFixture-0.13.tar.gz, OVID, 2018; MetaCPAN )
DBIx-Class-EasyFixture/lib/DBIx/Class/EasyFixture.pm ( view source; MetaCPAN )
t, while
appropriate for some, is not what I wanted (such as the necessity of storing
fixtures in JSON files), and had a reliance on knowing the values of primary
keys, I wrote this to make it easier 
TaskPipe ( T/TO/TOMGRACEY/TaskPipe-0.09.tar.gz, TOMGRACEY, 2018; MetaCPAN )
TaskPipe/lib/TaskPipe/TaskUtils.pm ( view source; MetaCPAN )
::TaskUtils;

use Moose;
use TaskPipe::Task::ModuleMap;
use Try::Tiny;
use TaskPipe::RunInfo;
use JSON;
use Data::Dumper;
use Log::Log4perl;
use Module::Runtime qw(require_module);

has sm => (is => '
 TaskPipe::RunInfo->new;
});

has json_encoder => (is => 'ro', isa => 'JSON', default => sub{
    my $json_enc = JSON->new;
    $json_enc->canonical;
    return $json_enc;
});

has settings => (is => 
 = $self->json_encoder->encode( $ref );
    } catch {
        confess "Serialize error: $_\nref was ".Dumper( $ref );
    };

    return $serialized;
}



sub deserialize{
    my ($self,$json) = @_;

Catmandu-FedoraCommons ( H/HO/HOCHSTEN/Catmandu-FedoraCommons-0.5.tar.gz, HOCHSTEN, 2018; MetaCPAN )
Catmandu-FedoraCommons/lib/Catmandu/FedoraCommons/Model/purgeDatastream.pm ( view source; MetaCPAN )

=head1 SEE ALSO

L<Catmandu::FedoraCommons>

=cut
package Catmandu::FedoraCommons::Model::purgeDatastream;

use JSON;

sub parse {
     my ($class,$bytes) = @_;
     return decode_json($bytes);
}

1;
Perinci-Script-Any ( P/PE/PERLANCAR/Perinci-Script-Any-0.001.tar.gz, PERLANCAR, 2018; MetaCPAN )
Perinci-Script-Any/lib/Perinci/Script/Any.pm ( view source; MetaCPAN )
mods;
    if ($ENV{GATEWAY_INTERFACE} || $ENV{FCGI_ROLE}) {
        @mods = ('Perinci::WebScript::JSON');
    } else {
        @mods = qw(Perinci::CmdLine::Any);
    }

    for my $i (1..@mods) {
    
tes the bug or desired
feature.

=head1 SEE ALSO

L<Perinci::CmdLine::Any>, L<Perinci::WebScript::JSON>

=head1 AUTHOR

perlancar <perlancar@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is c
TaskPipe ( T/TO/TOMGRACEY/TaskPipe-0.09.tar.gz, TOMGRACEY, 2018; MetaCPAN )
TaskPipe/lib/TaskPipe/Task.pm ( view source; MetaCPAN )
oduleMap;
use MooseX::ClassAttribute;
use TaskPipe::InterpParam;
use TaskPipe::LoggerManager;
use JSON;
use TaskPipe::ThreadManager;
use TaskPipe::Iterator_Array;
use TaskPipe::RunInfo;
use TaskPipe::
App-CharmKit ( A/AD/ADAMJS/App-CharmKit-2.11.tar.gz, ADAMJS, 2018; MetaCPAN )
App-CharmKit/lib/App/CharmKit/Manual/GettingStarted.pod ( view source; MetaCPAN )
use charm;

   pkg [
    'nginx-full', 'php-fpm',      'php-cgi',      'php-curl', 'php-gd', 'php-json',
    'php-mcrypt', 'php-readline', 'php-mbstring', 'php-xml'
   ],
   ensure    => "present",
  
ARGV-Struct ( J/JL/JLMARTIN/ARGV-Struct-0.06.tar.gz, JLMARTIN, 2018; MetaCPAN )
ARGV-Struct/lib/ARGV/Struct.pm ( view source; MetaCPAN )
on. Here are some strategies that
I've found over time: 

=head2 Complex arguments codified as JSON

JSON is horrible for the command line because you have to escape the quotes. It's a nightmare.

  c
hub.com/pplu/ARGV-Struct

=head1 THANKS

Matt S. Trout for suggesting that ARGV::Struct syntax be JSONY compatible

=head1 AUTHOR

    Jose Luis Martinez
    CPAN ID: JLMARTIN
    CAPSiDE
    jlmartin
HTTP-Accept ( R/RE/RENEEB/HTTP-Accept-0.03.tar.gz, RENEEB, 2018; MetaCPAN )
HTTP-Accept/lib/HTTP/Accept.pm ( view source; MetaCPAN )
 application/json;q=0.5';
    my $accept_header  = HTTP::Accept->new( $header );
    
    # returns text/html
    my $use_accept     = $accept_header->match( qw(text/html application/json) );

=head1 
----------------+----------------------------
  text/html, application/json;q=0.5 | text/html, application/json
  application/json;q=0.5, text/html | text/html, application/*
  application/*;q=0.5, te
der         = 'text/html, application/json;q=0.5';
    my $accept_header  = HTTP::Accept->new( $header );

=head2 match

    # header: 'text/html, application/json;q=0.5'
    my $accept = $accept_head
MySQL-Sandbox ( G/GM/GMAX/MySQL-Sandbox-3.2.18.tar.gz, GMAX, 2018; MetaCPAN )
MySQL-Sandbox/lib/MySQL/Sandbox/Scripts.pm ( view source; MetaCPAN )
_paths.sh',
'change_ports.sh',
'USING',
'README',
'connection.json',
'default_connection.json',
'grants.mysql',
'grants_5_7_6.mysql',
'json_in_db.sh',
'show_binlog.sh',
'show_relaylog.sh',
'add_option
fi
fi

KILL_SCRIPT

'json_in_db.sh' => <<'JSON_IN_DB_SCRIPT',

#!_BINBASH_
__LICENSE__
SBDIR="_HOME_DIR_/_SANDBOXDIR_"
cd $SBDIR
./use -e 'drop table if exists test.connection_json'
./use -e 'create t
st.connection_json(t longtext)'
./use -e '/*!50708 alter table test.connection_json modify t json */'
#./use -e "insert into test.connection_json values (load_file('$SBDIR/connection.json'))"
./use -e
TaskPipe ( T/TO/TOMGRACEY/TaskPipe-0.09.tar.gz, TOMGRACEY, 2018; MetaCPAN )
TaskPipe/lib/TaskPipe/UserAgentManager/UserAgentHandler.pm ( view source; MetaCPAN )
  TaskPipe::RunInfo->new;
});
has json_encoder => (is => 'ro', isa => 'JSON', default => sub{
    my $json_enc = JSON->new;
    $json_enc->canonical;
    return $json_enc;
});



sub build_ua{
    my 
r = Log::Log4perl->get_logger;
    $self->clear_cookies;
    $logger->info(uc($method)." ".$self->json_encoder->encode(\@params));
    my $resp = $self->ua->$method(@params);

    return $resp;
}



s
MySQL-Sandbox ( G/GM/GMAX/MySQL-Sandbox-3.2.18.tar.gz, GMAX, 2018; MetaCPAN )
MySQL-Sandbox/lib/MySQL/Sandbox.pm ( view source; MetaCPAN )

                    sbinstr
                    get_json_from_dirs
                    get_option_file_contents 
                    validate_json_object
                    fix_server_uuid
         
uid\n" if $DEBUG;
}

sub validate_json_object {
    my ($json_filename, $json_text) = @_;

    my $JSON_module = undef;
    for my $module ( 'JSON', 'JSON::PP', 'JSON::XS')
    {
        eval "use $mo
t "# Using $module\n" if $DEBUG;
            $JSON_module=$module;
           last; 
        }
    }
    unless ($JSON_module)
    {
        print "# JSON modules not installed - skipped evaluation\n"
Finance-CoinbasePro-Lite ( P/PE/PERLANCAR/Finance-CoinbasePro-Lite-0.004.tar.gz, PERLANCAR, 2018; MetaCPAN )
Finance-CoinbasePro-Lite/lib/Finance/CoinbasePro/Lite.pm ( view source; MetaCPAN )
iny->new;

    require JSON::XS;
    $self->{_json} = JSON::XS->new;

    require URI::Encode;
    $self->{_urienc} = URI::Encode->new;

    bless $self, $class;
}

sub _get_json {
    my ($self, $url
) = @_;

    log_trace("JSON API request: %s", $url);

    my $res = $self->{_http}->get($url);
    die "Can't retrieve $url: $res->{status} - $res->{reason}"
        unless $res->{success};
    my $d
ecoded;
    eval { $decoded = $self->{_json}->decode($res->{content}) };
    die "Can't decode response from $url: $@" if $@;

    log_trace("JSON API response: %s", $decoded);

    $decoded;
}

sub _
Bio-Grid-Run-SGE ( J/JW/JWB/Bio-Grid-Run-SGE-0.066.tar.gz, JWB, 2018; MetaCPAN )
Bio-Grid-Run-SGE/lib/Bio/Grid/Run/SGE/Util.pm ( view source; MetaCPAN )
ec::Functions qw/catfile/;
use Data::Dumper;
use List::Util qw/min/;
use Path::Tiny;
use JSON::XS qw/encode_json/;
use Bio::Gonzales::Util::Log;

use base 'Exporter';
our ( @EXPORT, @EXPORT_OK, %EXPOR
MooseX-DataModel ( J/JL/JLMARTIN/MooseX-DataModel-1.01.tar.gz, JLMARTIN, 2018; MetaCPAN )
MooseX-DataModel/lib/MooseX/DataModel.pm ( view source; MetaCPAN )
name, \%properties);
  }

  sub new_from_json {
    my ($class, $json) = @_;
    require JSON::MaybeXS;
    return $class->new(JSON::MaybeXS::decode_json($json));
  }

}

1;
### main pod documentation
ce 
    has foo => (...);
  }

  my $obj = MyModel->MooseX::DataModel::new_from_json('{"version":3,"description":"a json document"}');
  # $obj is just a plain old Moose object
  print $obj->version;
e key passed is different from the one declared: you
get an exception. The advantage over using a JSON validator, is that after validation you still have
your original datastructure. With MooseX::Data

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