'0.01';
use LWP::UserAgent;
use MIME::Base64 'encode_base64';
use Sys::Hostname;
use POSIX;
use JSON::XS;
use Sub::Name;
use Carp;
use Class::Tiny;
my @LEVELS;
BEGIN {
@LEVELS = qw( fatal erro
;
$message = encode_json $message;
my $response = $self->{ua}->post(
$self->{uri},
'X-Sentry-Auth' => $auth,
'Content-Type' => 'application/json',
Content
ecoded_content;
}
die $response->status_line;
}
my $answer_ref = decode_json $response->decoded_content;
die 'Wrong answer format' unless $answer_ref && $answer_ref->{id
package SQS::Worker::Client {
use Moose;
use Paws;
use JSON::MaybeXS;
use MIME::Base64;
use Storable qw/nfreeze/;
has queue_url => (is => 'ro', isa => 'Str', required => 1);
has region
o', isa => 'Str', default => 'json');
has _serializer => (is => 'ro', isa => 'HashRef[CodeRef]', default => sub {
return {
json => sub { return encode_json \@_; },
storable => su
s->headers->content_type;
if (defined($type)
&& $type =~ /text|xml|javascript|json/
&& ($c->req->headers->accept_encoding // '') =~ /gzip/i) {
$c->res->head
p, but this can be overridden if desired.
The author's use-case is for providing more context in JSON-based application logs, where all helpers would identify themselves as __ANON__.
=head1 HELPERS
andidates = [
'JSON::PP::Boolean',
'boolean',
'JSON::XS::Boolean',
'Types::Serialiser::Boolean', # should not be needed
'Mojo::JSON::_Bool', # o
rk.
=item *
L<JSON::PP::Boolean>
=item *
L<boolean>
=item *
L<JSON::XS::Boolean>
=item *
L<Types::Serialiaser::Boolean> (although it should not be needed)
=item *
L<Mojo::JSON::_Bool>, for L
<Mojolicious> up to version 6.21 (it later
switched to L<JSON::PP::Boolean>).
=back
=head2 Unsupported References
When a reference that is neither a hash nor an array reference is found,
method L<
user's behalf.
=item s3_policy_upload_signature (required)
The signature of the Base64 encoded JSON document.
=item bundle_error_code (optional)
Error code for bundle failure.
=item bundle_error
')->format_datetime(DateTime->now(time_zone =>
'local')),
'format' => 'json',
'v' => '2.0',
};
foreach ('set_target_app_key', 'set_session', 'se
.
=item Storage.S3.UploadPolicySignature (required)
The signature of the Base64 encoded JSON document.
JSON Parameters: (all are required)
expiration - The expiration of the policy. Amazon recomme
e warnings;
use Mojo::UserAgent;
use Aliyun::AuthV2;
use Data::Dumper qw/Dumper/;
use Cpanel::JSON::XS;
use version;
our $VERSION = 0.2;
sub new {
my $class = shift;
$class = (ref $
ss {}, $class;
$self->{'http_head'} = {
'Accept' => 'application/json,*/*;q=0.8,',
'Accept-Encoding' => 'deflate',
'Accept-Language'
my $result = {};
if (my $res = $tx->success) {
$result = decode_json($res->body) || {};
}
else {
my $err = $tx->error;
Move tasks to and from the shelf.
use strict;
use warnings;
use Moo;
use MooseX::MungeHas;
use JSON;
use Clone 'clone';
extends 'Taskwarrior::Kusarigama::Plugin';
with 'Taskwarrior::Kusarigama::
unless $tasks;
foreach my $task (@$tasks) {
my $new = clone $task;
$new->{shelved} = $JSON::true;
$new->{shelf_ts} = time() =~ s/\.\d+$//r unless $task->{shelved};
$self->import_t
less $tasks;
foreach my $task (@$tasks) {
my $new = clone $task;
$new->{ shelved } = $JSON::false;
$self->import_task($new);
}
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Ta
package Aliyun::Method::FcSmsNumSend;
use 5.010;
use Data::Dumper qw/Dumper/;
use Cpanel::JSON::XS;
use version;
our $VERSION = 0.1;
#阿里大于短信发送
sub new {
my $class = shift;
1];
}
#设置内容替换
sub set_sms_param {
$_[0]->{'params'}->{'sms_param'} = encode_json($_[1]);
}
sub get_params {
return $_[0]->{'params'};
}
1;
__DATA__
=encoding u
sponse;
use Crypt::OpenSSL::X509;
use Crypt::PK::ECC;
use Digest::SHA qw(sha256);
use JSON::MaybeXS qw(encode_json);
use List::Util qw(first);
use MIME::Base64 qw(encode_base64url decode_base64url);
u
ge,
origin => $app_id,
cid_pubkey => 'unused');
my $client_data = encode_json(\%client_data);
my $sign_data = pack 'x a32 a32 a* a65',
sha256($app_id),
sh
ge,
origin => $app_id,
cid_pubkey => 'unused');
my $client_data = encode_json(\%client_data);
my $pkec = $self->keystore->get($handle);
my $counter = ++$COUNTER;
package Druid;
use Moo;
use JSON::MaybeXS qw(encode_json decode_json);
use LWP::UserAgent;
use HTTP::Request;
use Druid::Util qw(iso8601_yyyy_mm_dd_hh_mm_ss);
our $VERSION = '0.004';
has 'api_url'
P::Request->new( 'POST' => $self->api_url );
$req->header( 'Content-Type' => 'application/json' );
return $req;
},
);
sub send {
my $self = shift;
my $query = shift;
f->req->content( encode_json( $request_hash ) );
my $res = $self->ua->request( $self->req );
if ($res->is_success) {
eval {
$response = decode_json($res->content) if $res-
ojo::Base 'Mojolicious::Plugin';
use Spreadsheet::WriteExcel;
use Clone qw/clone/;
use Mojo::JSON qw/to_json/;
sub export_excel_renderer{
my ($r, $c, $output, $options) = @_;
# 不需要编码
my $df;
my $cf_json = to_json($cf);
if($df_cache->{$cf_json}){
$df = $df_cache->{$cf_json};
}else{
$df_cache->{$cf_json} = $df = $excel_obj->add_format(%
PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR"]],
},
);
sub _get_json {
require HTTP::Tiny;
require JSON::MaybeXS;
my ($url) = @_;
my $res = HTTP::Tiny->new->get($url);
;
eval { $data = JSON::MaybeXS::decode_json($res->{content}) };
return [500, "Can't decode JSON: $@"] if $@;
[$res->{status}, $res->{reason}, $data];
}
sub _get_json_cmc {
my $url =
shift;
my $res = _get_json($url);
{
last unless $res->[0] == 200;
if (ref($res) eq 'HASH' && $res->{error}) {
$res = [500, "Got error response from CMC API: $res->
dir );
use IPC::SRLock::Constants ( );
my $Assert = sub {};
my $Config_Extn = '.json';
my $Exception_Class = 'Class::Usul::Exception';
my $Log_Levels = [ qw( alert debug error f
ead2 COMMA
The comma character
=head2 CONFIG_EXTN
The default configuration file extension, F<.json>. Change this by
setting the C<Config_Extn> class attribute
=head2 DEFAULT_CONFHOME
Default dir
ings;
use strict;
use utf8;
use Carp;
our $VERSION = 'v2.0.1';
use Export::Attrs;
use JSON::XS qw( encode_json );
use URI::Escape qw();
use HTML::Entities qw();
use constant UNSAFE_HTML=> '&"\'<>'
xport {
my ($s) = @_;
if ($POST eq UTF8POST) {
$s = JSON::XS->new->encode($s);
} else {
$s = encode_json($s);
}
$s =~ s{</script}{<\\/script}xmsg;
return $s;
}
$complex );
Encode $complex data structure (HASHREF, ARRAYREF, etc. - any data type
supported by JSON::XS) for inserting into JavaScript code (usually inside
HTML templates).
Example:
<script>
Provides the DBIC connect information array reference
=head1 Configuration and Environment
The JSON data looks like this:
{
"credentials" : {
"schedule" : {
"driver" : "m
scribe_options );
use Data::Record;
use Encode qw( decode );
use JSON::MaybeXS qw( decode_json );
use Scalar::Util qw( blessed );
use Moo::Role;
my $Extra_Argv = []
val; defined ($val = $cmdline_opt->$name()) and
$params->{ $name } = $option->{json} ? decode_json( $val ) : $val;
}
$option->{required} and not defined $params->{ $name }
ata::Record>
=item L<Encode>
=item L<Getopt::Long>
=item L<Getopt::Long::Descriptive>
=item L<JSON::MaybeXS>
=item L<Moo::Role>
=back
=head1 Incompatibilities
There are no known incompatibilit