bject::LinkHighlightingMode;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
Object::HorizontalAlignment;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Da
use HTTP::Request::Common qw(DELETE POST GET HEAD PUT);
use HTTP::Status;
use URI::Query;
use JSON;
use URI::Escape;
use Scalar::Util;
use Log::Any qw($log);
use Carp;
use Module::Runtime qw(
".$_url."\n";
}
# body data
$body_data = to_json($body_data->to_hash) if defined $body_data && $body_data->can('to_hash'); # model to json string
my $_body_data = keys %$post_params > 1
eturn $value->datetime();
}
else {
return $value;
}
}
# Deserialize a JSON string into an object
#
# @param string $class class name is passed as a string
# @param str
ervice::Jandi::WebHook::VERSION = 'v0.0.1';
use strict;
use warnings;
use HTTP::Tiny;
use JSON qw/encode_json/;
=encoding utf8
=head1 NAME
WebService::Jandi::WebHook - Perl interface to Jandi Serv
',
accept => 'application/vnd.tosslab.jandi-v2+json',
'content-type' => 'application/json',
}
),
};
bless $self, $class;
return
ge } unless ref $message;
my $json = encode_json($message);
my $res = $self->{http}->request(
'POST',
$self->{url},
{ content => $json }
);
return $res;
}
=h
default_headers => {
'Fastly-Key' => $token,
'Accept' => 'application/json'
},
);
return $http_requester;
}
=head1 Net::Fastly
Methods below return objec
etc/service.conf
(make sure this file is not served by your httpd)
The configuration must be in JSON format. I.e., something like
{
Common: {
"CORS": {
"Allow-Origin"
Carp;
use Modern::Perl;
use Encode qw(decode encode);
use Plack::Request;
use Plack::Builder;
use JSON;
use XML::LibXML;
use Clone 'clone';
use XML::LibXML::PrettyPrint;
use parent qw/Plack::Componen
ion for the services. The top
level keys are service names. If it is a file, it is expected to be
JSON. A configuration in a file may use top level Common hash and
references. A reference is a key,val
package Test::AnsibleModule;
use Mojo::Base -base;
use Test::More;
use Mojo::JSON qw/decode_json encode_json/;
use Mojo::Asset::File;
use Carp qw/croak/;
use Data::Dumper qw/Dumper/;
$Data::Dumper::S
rgs = ref $_[0] ? $_[0] : {@_};
my $file = Mojo::Asset::File->new;
$file->add_chunk(encode_json($args));
my $p;
open($p, "-|", join(" ", $module, $file->path))
// croak "Could not run
my $response = "";
while (my $line = <$p>) {
$response .= $line;
}
my $res = decode_json($response);
$self->last_response($res);
close $p;
return $? >> 8;
}
sub _test {
my ($sel
use Mojo::Base -base;
our $VERSION = '0.4';
=for comment
We want JSON
WANT_JSON
=cut
use Mojo::JSON qw/decode_json encode_json/;
use Mojo::File qw/path/;
use POSIX qw/locale_h/;
use Carp qw/croa
0])->slurp;
my $json = decode_json($args);
return $json if defined $json;
my $params = {};
for my $arg (split $args) {
my ($k, $v) = split '=', $arg;
$self->fail_json(
{msg => 'T
his module requires key=value style argument: ' . $arg})
unless defined $v;
$self->fail_json({msg => "Duplicate parameter: $k"})
if exists $params->{$k};
$params->{$k} = $v;
}
ctor>
#include <algorithm>
#include <utility>
#include <iostream>
#include "./base.h"
#include "./json.h"
#include "./logging.h"
#include "./type_traits.h"
#include "./optional.h"
namespace dmlc {
//
d());
}
/*!
* \brief Write the parameters in JSON format.
* \param writer JSONWriter used for writing.
*/
inline void Save(dmlc::JSONWriter *writer) const {
writer->Write(this->__DI
\brief Load the parameters from JSON.
* \param reader JSONReader used for loading.
* \throw ParamError when something go wrong.
*/
inline void Load(dmlc::JSONReader *reader) {
std::map<
rvice, either as a file or as a variable in the call to
Geo::OGC::Service->new.
The file must be JSON and either have top level key WMTS, WMS, or TMS
if more than one service is defined. The value of
10000; # say // and //=
use feature "switch";
use Carp;
use File::Basename;
use Modern::Perl;
use JSON;
use Geo::GDAL;
use Cwd;
use Math::Trig;
use HTTP::Date;
use Data::Dumper;
use XML::LibXML::Pret
ndef;
} else {
my $json = JSON->new;
$json->allow_blessed([1]);
my $writer = $self->{responder}->([200, [ 'Content-Type' => 'application/json',
rs
* \file json.h
* \brief Lightweight JSON Reader/Writer that read save into C++ data structs.
* This includes STL composites and structures.
*/
#ifndef DMLC_JSON_H_
#define DMLC_JSON_H_
// Thi
namespace dmlc {
/*!
* \brief Lightweight JSON Reader to read any STL compositions and structs.
* The user need to know the schema of the
*
*/
class JSONReader {
public:
/*!
* \brief Constr
he input stream.
*/
explicit JSONReader(std::istream *is)
: is_(is),
line_count_r_(0),
line_count_n_(0) {}
/*!
* \brief Parse next JSON string.
* \param out_str the
e aliases C<ttl> for C<Turtle>, C<n3> for
C<Notation3>, C<xml> and C<XML> for C<RDFXML>, C<json> for C<RDFJSON>.
When the option C<type> is set to 'NTriples' the export can be streamed in all
other
Ttl => 'Turtle',
N3 => 'Notation3',
Xml => 'RDFXML',
XML => 'RDFXML',
Json => 'RDFJSON',
);
has type => (
is => 'ro',
coerce => sub { my $t = ucfirst($_[0]); $TYPE_ALIAS
porter::RDF>
Serialize RDF data (as RDF/XML, RDF/JSON, Turtle, NTriples, RDFa...)
=item L<Catmandu::Importer::RDF>
Parse RDF data (RDF/XML, RDF/JSON, Turtle, NTriples...) or import from a SPARQL
en
use Moo;
use WWW::Mechanize;
use Method::Signatures 20121201;
use WebService::HabitRPG::Task;
use JSON::MaybeXS;
use Data::Dumper;
use Carp qw(croak);
our $DEBUG = $ENV{HRPG_DEBUG} || 0;
our $TAG_PRE
);
has 'api_base' => (is => 'ro', default => sub { 'https://habitica.com/api/v3' });
has '_last_json' => (is => 'rw'); # For debugging
has 'tags' => (is => 'rw');
has 'tag_prefix' => (is => 'r
= 1,
:$down = 1,
:$extend = {},
) {
# Magical boolification for JSONification.
# TODO: These work with JSON::XS. Do they work with other backends?
$up = $up ? \1 : \0;
$d
ec;
use File::HomeDir;
use Readonly;
use Carp;
use LWP::UserAgent;
use HTTP::Request::Common;
use JSON;
use URI;
use Data::Printer;
Readonly our %DEFAULTS => (
DRIP_TOKEN => undef,
DRIP_ID
if ( ref($content) ) {
$request->content_type('application/vnd.api+json');
$request->content( encode_json( $content ) );
}
$request->authorization_basic( $self->{DRIP_TOKEN},
return undef;
}
my $decoded = eval {decode_json( $result->content )};
if ( $@ ) {
$self->{debugger}->('Failed to decode JSON:', $@, $result->content);
die $result;
}
package Net::PMP::Profile;
use Moose;
use Data::Dump qw( dump );
use Data::Clean::JSON;
use Net::PMP::Profile::TypeConstraints;
use Net::PMP::CollectionDoc;
use Net::PMP::CollectionDoc::Link;
our $VE
les/base'}
sub get_profile_title { ref(shift) }
# singleton for class
my $cleaner = Data::Clean::JSON->new(
DateTime => [ call_method => 'stringify' ],
'Net::PMP:
0.04';
# ABSTRACT: Airbrake Notifier API V2 Client
use Net::Airbrake 0.02;
use JSON::MaybeXS qw(encode_json decode_json);
use XML::Simple qw(xml_in xml_out);
our @ISA = 'Net::Airbrake';
# Net::Ai
sub convert_request {
my ($self, $req, $opts) = @_;
my $string = !ref $req;
$req = decode_json($req) if $string;
$opts ||= {};
my $mod = $opts->{mod} || ref($self) || $self;
my $ap
SuppressEmpty => 1,
XMLDecl => q[<?xml version="1.0" encoding="utf-8"?>],
);
# decode_json should return a structure with character strings,
# and XML::Simple doesn't encode until writin
m/$CORE_PAIR_RE/) {
$self->parse_symbol($1, &_decode_JSON_string($2), &_decode_colour($3), $4);
$self->parse_symbol($4, &_decode_JSON_string($5), &_decode_colour($6), $1);
} elsif ($line =~
/) {
$self->parse_symbol($1, &_decode_JSON_string($2), &_decode_colour($3));
} elsif ($line =~ m/$AMBIG_RE/) {
$self->parse_symbol($1, &_decode_JSON_string($2), &_decode_colour($3), undef, $
$sym) = @_;
my $name_info = '';
if (defined($sym->{name})) {
$name_info = ' "' . &_encode_JSON_string($sym->{name}) . '"';
}
my $colour_info = '';
if (defined($sym->{colour})) {
$col
e RDF::Query;
use RDF::LDF;
use RDF::aREF;
use RDF::aREF::Encoder;
use RDF::NS;
use IO::Pipe;
use JSON;
use LWP::UserAgent::CHICaching;
our $VERSION = '0.32';
with 'Catmandu::RDF';
with 'Catmandu::I
de($pipe,':encoding(UTF-8)');
return sub {
state $line = <$pipe>;
return decode_json($line) if defined($line);
waitpid($pid,0);
return undef;
};
}
else {
#
is_literal ? $triple->object->literal_datatype : undef;
# Create the RDF::Trine type RDF/JSON RDF::aREF can parse
my $hashref = {};
$hashref->{$subject}->{$predicate}->[0]->{
package WebService::HabitRPG::Task;
use v5.010;
use strict;
use warnings;
use autodie;
use JSON::MaybeXS qw(is_bool);
use Moo;
use Scalar::Util qw(looks_like_number);
use POSIX qw(strftime);
use Carp
($self, $args) = @_;
# Since we're usually being called directly with the results of
# a JSON parse, we want to record that original structure here.
$self->_raw($args);
}
sub active_to