ath::Tiny>
=head3 L<File::pushd>
=head3 L<File::Copy::Recursive>
=head2 Data Format
=head3 L<JSON::XS>
=head3 L<Data::MessagePack>
=head3 L<Text::CSV>
=head3 L<TOML>
=head3 L<YAML>
=head2 P
ll function name, the
calling context ("L" or "S"), and all the function arguments with canonical
JSON (sorted hash keys). e.g. these calls will be memoized together:
memoized_function({a => 5, b
y be returned as a list, list reference or hash
reference; it will automatically be serialized to JSON in canonical mode
(sorted hash keys).
For example, this uses the second and third argument to th
package Plack::App::JSONRPC;
use 5.008001;
use strict;
use warnings;
our $VERSION = "0.02";
use parent qw(Plack::Component);
use JSON::RPC::Spec;
use Plack::Request;
use Plack::Util::Accessor qw(rpc)
;
sub prepare_app {
my ($self) = @_;
my $rpc = JSON::RPC::Spec->new;
while (my ($name, $callback) = each %{$self->{methods}}) {
$rpc->register($name, $callback);
}
$self->
tent-Type' => 'application/json'], [$body]];
}
return [204, [], []];
}
1;
__END__
=encoding utf-8
=head1 NAME
Plack::App::JSONRPC - (DEPRECATED) Yet another JSON-RPC 2.0 psgi application
Glacier::ListVaults;
our $VERSION = '1.120';
use strict;
use warnings;
use utf8;
use Carp;
use JSON::XS 1.00;
use App::MtAws::Utils;
use App::MtAws::MetaData;
sub new
{
my $class = shift;
my $
elf, $class;
$self;
}
sub _parse
{
my ($self) = @_;
return if $self->{data};
$self->{data} = JSON::XS->new->allow_nonref->decode(${ delete $self->{rawdata} || confess });
}
sub get_list_vaults
tAws::QueueJob';
sub init
{
my ($self) = @_;
$self->{format} or confess;
$self->{format} =~ /^json|csv$/ or confess;
$self->enter('retrieve');
}
sub on_retrieve
{
my ($self) = @_;
return state
::Glacier::ListJobs;
our $VERSION = '1.120';
use strict;
use warnings;
use utf8;
use Carp;
use JSON::XS 1.00;
use App::MtAws::Utils;
use App::MtAws::MetaData;
sub new
{
my $class = shift;
my $
f->{data};
$self->{data} = JSON::XS->new->allow_nonref->decode(${ delete $self->{rawdata} || confess });
# get rid of JSON::XS boolean object, just in case.
# also JSON::XS between versions 1.0 an
ment download, in megabytes
check-local-hash
retrieve-inventory
--request-inventory-format - json or csv
download-inventory
--new-journal - Write inventory as new journal
create-vault VAULT-
etrieve_inventory
{
my ($self, $format) = @_;
$format or confess;
if ($format eq 'json') {
$format = 'JSON';
} elsif ($format eq 'csv') {
$format = 'CSV';
} else {
confess "unknown invent
ype;
if ($ct eq 'text/csv') {
INVENTORY_TYPE_CSV
} elsif ($ct eq 'application/json') {
INVENTORY_TYPE_JSON
} else {
confess "Unknown mime-type $ct";
}
};
return ($resp->content, $it
resp->content_type && $resp->content_type eq 'application/json') {
my $json = JSON::XS->new->allow_nonref;
my $scalar = eval { $json->decode( $resp->content ); }; # we assume content always
validation(option('request-inventory-format', default => 'json'),
message('request-inventory-format must be "json" or "csv"'), sub { /^(json|csv)$/ });
validation positional('vault-name'), messa
package LaTeXML::Plugin::LtxMojo;
use Mojo::Base 'Mojolicious';
use Mojo::JSON;
use Mojo::IOLoop;
use Mojo::ByteStream qw(b);
use File::Basename 'dirname';
use File::Spec::Functions qw(catdir catfile
stom';
# }
# }
$app->helper(convert_string => sub {
my ($self) = @_;
my ($source,$is_jsonp);
my $get_params = $self->req->url->query->params || [];
my $post_params = $self->req->body_
Smarter fix??)
while (my ($key,$value) = splice(@all_params,0,2)) {
# JSONP ?
if ($key eq 'jsonp') {
$is_jsonp = $value;
next;
} elsif ($key =~ /^(?:tex|source)$/) {
#
et::Amazon::Signature::V4;
use Net::Amazon::TreeHash;
use HTTP::Request;
use LWP::UserAgent;
use JSON 2.61;
use POSIX;
use Digest::SHA;
use File::Slurp 9999.19;
use Carp;
=head1 NAME
Net::Amazon::G
lf->_send_receive(
PUT => "/-/vaults/$vault_name/notification-configuration",
[
],
encode_json($content_raw),
);
# updated error severity
croak 'get_vault_notifications failed with error '
topic);
my $res = $self->_send_receive(
POST => "/-/vaults/$vault_name/jobs",
[ ],
encode_json($content_raw),
);
# updated error severity; method must return a job id
croak 'initiate_archiv
MtAws::LineProtocol;
our $VERSION = '1.120';
use strict;
use warnings;
use utf8;
use Carp;
use JSON::XS;
use App::MtAws::Utils;
use Exporter 'import';
our @EXPORT = qw/ get_data send_data/;
our @
n unit-test it (JSON and YAML have different serialization implementeation)
my $json_coder = JSON::XS->new->ascii(1)->allow_nonref;
sub decode_data
{
my ($data_e) = @_;
return $json_coder->decode($
data_e);
}
sub encode_data
{
my ($data) = @_;
return $json_coder->encode($data);
}
sub get_data
{
my ($fh) = @_;
my ($len, $line);
sysreadfull_chk($fh, $len, 8) &&
sysreadfull_chk($fh, $lin
use Exporter 'import';
use constant INVENTORY_TYPE_CSV => 'CSV';
use constant INVENTORY_TYPE_JSON => 'JSON';
our @EXPORT = qw/set_filename_encoding get_filename_encoding binaryfilename
sanity_relati
ze file_mtime file_exists file_inodev
is_64bit_os is_64bit_time is_y2038_supported
INVENTORY_TYPE_JSON INVENTORY_TYPE_CSV/;
BEGIN {
if ($File::Spec::VERSION lt '3.13') {
our $__orig_abs_to_rel =
->status_line."\n";
$out .= $resp->headers->as_string;
if ($resp->content_type eq 'application/json' && $resp->content && length($resp->content)) {
$out .= "\n".$resp->content;
}
$out .= "\n\n"
may also use one of the escape sequences understood by tpath, which are
just those understood by JSON. These are
=over 4
=item \t
The tab character.
=item \n
The ASCII newline character -- decim
cal tab character. Why \v? Well, I figure it's important enough to somebody to be
included in the JSON spec, so it's here too. This is character 11 in ASCII's decimal set.
=back
=head1 HISTORY
I wr
efine.h" */
/* #include "str_array.h" */
/* #include "match_entry.h" */
#ifdef ENABLE_JSON
#include <json-c/json.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
struct _edge;
struct _node;
struct
_JSON
json_object * r3_edge_to_json_object(const edge * e);
json_object * r3_node_to_json_object(const node * n);
json_object * r3_route_to_json_object(const route * r);
const char * r3_node_to_json_
string_ext(const node * n, int options);
const char * r3_node_to_json_pretty_string(const node * n);
const char * r3_node_to_json_string(const node * n);
#endif
#ifdef __cplusplus
}
#endif
#endif /*
our $VERSION = '1.120';
use strict;
use warnings;
use utf8;
use Encode;
use MIME::Base64;
use JSON::XS;
use POSIX;
use Time::Local;
use App::MtAws::DateTime;
use constant MAX_SIZE => 1024;
use co
ed, characters '+', '/' replaced with '-', '_' resp. and no new lines.
json_utf8() - input - Hash, output - byte sequence
JSON string in UTF-8 representation. Can contain not-escaped UTF-8 character
': FILENAME, 'mtime': iso8601(MTIME)}
Hash with two keys: 'filename' and 'mtime'. Corresponds to JSON 'Object'.
Input data:
=====================
FILENAME (character string)
Is a relative filename
mentref = \$r;
$console_out = "Downloaded inventory in ".($inventory_type eq INVENTORY_TYPE_JSON ? "JSON" : "CSV")." format";
} elsif ($action eq 'retrieve_archive') {
my $req = App::MtAws::Glaci
sync::JSONStream;
use strict;
use warnings;
our $VERSION = '0.02';
use base qw( IO::Async::Stream );
IO::Async::Stream->VERSION( '0.57' ); # ->read future
use JSON qw( encode_json decode_json );
IO::Async::JSONStream> - send or receive lines of JSON data in C<IO::Async>
=head1 SYNOPSIS
use IO::Async::JSONStream;
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my $jsonstream = IO
d( $jsonstream );
$jsonstream->connect(
host => "my.server",
service => 12345,
)->then( sub {
$jsonstream->write_json( [ data => { goes => "here" } ] );
$jsonstream->read_json
}
mac_sha256 hmac_sha512);
use MIME::Base64 qw(encode_base64url decode_base64url);
use JSON qw(decode_json encode_json);
use Try::Tiny;
# Constructor attributes
has enc => ( is => 'rw');
has alg
->encode(encode_json($hash));
}
# -----------------------------------------------------------------------------
sub decode_to_hash {
my ($self, $jwe) = @_;
return decode_json($self->decode(
y = ''; # Empty for 'dir' algorithm
my @segment;
push @segment, encode_base64url( encode_json($header) );
push @segment, encode_base64url( $jwe_encryptedKey );
push @segment, encode_b
in arrays and hashrefs. When the object goes out of scope its contents
are saved to the log as a JSON string.
PLEASE NOTE: Until this module reaches version 1.0, I might make some
non-backwards-comp
stage'} = 1;
$qnd->{'tracks'} = [qw{1 4}];
$qnd->{'coord'} = {x=>1, z=>42};
which results in a JSON string like this:
{"stage":1,"tracks":["1","4"],"time":"Tue May 20 17:13:22 2014","coord":{"x":
he only input for this method is the string to write to the log. The string
should already be in JSON format and should have no newline. C<write_entry()>
doesn't do anything about formatting the str