ex::API::Request);
use strict;
use constant URL => 'https://cavirtex.com/api2/user/orders.json';
use constant ATTRIBUTES => qw(currencypair days startdate enddate);
use constant DATA_KEY =>
gging methods for the
defined log levels, such as C<debug> or C<error>.
package MyApp::View::JSON;
extends 'MyApp::View';
with 'Catmandu::Logger';
sub bar {
$self->log->info
}
Your package automatically has a logging category of MyApp::View::JSON. Use lines like:
log4perl.logger.MyApp::View::JSON=DEBUG,STDOUT
or
log4perl.logger.MyApp::View=DEBUG,STDOUT
or
I::Request);
use strict;
use constant URL => 'https://cavirtex.com/api2/user/order_cancel.json';
use constant ATTRIBUTES => qw(id);
use constant DATA_KEY => undef;
sub url { U
the root directory of
your programming project. The file can be YAML, JSON or Perl and is called
C<catmandu.yml>, C<catmandu.json> or C<catmandu.pl>. In this file you can set
the default Catmandu sto
andu::Util qw(data_at);
use Catmandu;
sub description {
<<EOS;
examples:
# export config to JSON
catmandu config
# or any other Catmandu::Exporter
catmandu config to YAML --fix 'delete_field(pas
Catmandu->exporter($into_args->[0], $into_opts);
} else {
$into = Catmandu->exporter('JSON', pretty => 1);
}
$into->add(defined $path ?
data_at($path, Catmandu->config
tion based on ketama consistent hashing
use Algorithm::ConsistentHash::Ketama;
use JSON::XS qw(encode_json decode_json);
with 'ShardedKV::Continuum';
has '_orig_continuum_spec' => (
is => 'ro',
);
lose the logger!") if $logger;
encode_json( $self->_orig_continuum_spec )
}
sub deserialize {
my $class = shift;
return $class->new(from => decode_json( $_[1] ));
}
sub clone {
my $self = s
I;
use strict;
use 5.008_005;
our $VERSION = '0.10';
use Moo;
use URI;
use LWP::UserAgent;
use JSON::XS;
use Business::MollieAPI::Payments;
use Business::MollieAPI::Methods;
use Business::MollieAP
key);
my $ua = LWP::UserAgent->new();
my $res = $ua->request($req);
my $data = decode_json($res->decoded_content);
$self->log_response({ request => $req, response => $res });
retur
PI::Request);
use strict;
use constant URL => 'https://cavirtex.com/api2/orderbook.json';
use constant ATTRIBUTES => qw(currencypair);
use constant DATA_KEY => 'orderboo
nyEvent::Handle;
use Protocol::WebSocket::Handshake::Client;
use Protocol::WebSocket::Frame;
use JSON;
use URI;
use Data::Dumper;
use constant VERBOSE => 1;
use constant DEBUG => 0;
use constant
to move and rewrite into your own module.
# within these subroutines you will have access to the json response in a hash format.
sub trade {
my $self = shift;
my $data = shift;
warn Data
my $msg = $self->frame->next) {
my $d;
eval {
$d = $self->json->decode($msg);
} or do {
my $e = $@;
warn $self->now
nyEvent::Handle;
use Protocol::WebSocket::Handshake::Client;
use Protocol::WebSocket::Frame;
use JSON;
use URI;
use Data::Dumper;
use constant VERBOSE => 1;
use constant DEBUG => 0;
use constant
to move and rewrite into your own module.
# within these subroutines you will have access to the json response in a hash format.
sub trade {
my $self = shift;
my $data = shift;
warn Data
my $msg = $self->frame->next) {
my $d;
eval {
$d = $self->json->decode($msg);
} or do {
my $e = $@;
warn $self->now
you are responsible for SSL cert verification code...
use LWP::UserAgent 6;
use URI;
use CGI;
use JSON;
use MIME::Base64;
use Time::HiRes qw(gettimeofday);
use Digest::SHA qw(hmac_sha256_hex);
use Dat
->uri . '?' . $uri->query);
}
$request->header(Accept => 'application/json');
# create a new user_agent each time...
$self->user_agent(LWP::UserAge
warn Data::Dumper->Dump([$self->http_response],['Response']) if DEBUG;
$content = $self->json->decode($self->http_response->content);
1;
} or do {
$content = {};
w
);
parameter content_type => (
isa => 'Str',
required => 1,
default => 'application/json',
);
parameter header_exclude => (
isa => 'HashRef',
default => sub {{}},
);
parameter
=> 10,
};
=over
=item content_type
By default the content type is set to "application/json"
=item header_exclude
Acts as a filter, will exclude any header information.
header_exclu
perform a POST request with REST::Consumer::post.
The data will the Content-Type of application/json by default.
=item Other supported HTTP methods
DELETE and PUT: delete(%params) and put(%param
="cexio-perl-module";
my $modver="0.2.3";
use vars qw($VERSION);
$cexio::VERSION = '0.2.3';
use JSON;
use Digest::SHA qw(hmac_sha256_hex);
use Hash::Flatten qw(:all);
use LWP::UserAgent;
my $ua = L
lic functions
sub ticker
{
my ($self, $primary, $secondary) = @_;
return $o->unflatten( $self->_json_get($cexio{urls}{api}{ticker}.$primary."/".$secondary) );
}
sub order_book
{
my ($self, $primar
@_;
if ( defined($depth) ) { $secondary .= "/?depth=${depth}"; }
return $o->unflatten( $self->_json_get($cexio{urls}{api}{order_book}.$primary."/".$secondary) );
}
sub trade_history
{
my ($self,
;
# ABSTRACT: Perl client for the Sensu API
$Sensu::API::Client::VERSION = '0.02';
use 5.010;
use JSON;
use Carp;
use Try::Tiny;
use Moo;
use namespace::clean;
with 'Sensu::API::Client::APICaller';
aller;
$Sensu::API::Client::APICaller::VERSION = '0.02';
use 5.010;
use Moo::Role;
use Carp;
use JSON;
use HTTP::Tiny;
our @CARP_NOT = qw/ Sensu::API::Client /;
has ua => (
is => 'ro',
def
is => 'ro',
default => sub { {
'Accept' => 'application/json',
'Content-type' => 'application/json',
}; },
);
sub get {
my ($self, $url) = @_;
my $r = $self->u
? decode_json($r->{content}) : 1;
}
sub post {
my ($self, $url, $body) = @_;
my $post = { headers => $self->headers };
if (defined $body) {
$post->{content} = encode_json($body);
e Business::MollieAPI::Resource;
use Moo::Role;
use HTTP::Request;
use HTTP::Request::Common;
use JSON::XS;
has client => (
is => 'ro',
);
requires 'name';
sub _create_request {
my $self =
$self->client->endpoint);
my $body = encode_json(\%args);
my $req = POST $url->as_string,
Content_Type => 'application/json',
Content => $body;
return $req;
}
sub
tex::API::Request);
use strict;
use constant URL => 'https://cavirtex.com/api2/user/order.json';
use constant ATTRIBUTES => qw(currencypair mode amount price);
use constant DATA_KEY => 'orde
you are responsible for SSL cert verification code...
use LWP::UserAgent 6;
use URI;
use CGI;
use JSON;
use MIME::Base64;
use Time::HiRes qw(gettimeofday);
use Digest::SHA qw(hmac_sha256_hex);
use Mat
i . '?' . $uri->query);
}
$request->header('Accept' => 'application/json');
#warn Data::Dumper->Dump([$request, $self->http_request]);
#warn sprin
DEBUG;
# apparently, the bitcoin address request returns the new addr as a string!!! (not json compatible)
if ($self->request->isa('Finance::BitStamp::API::Request::BitcoinAddress')) {
);
parameter content_type => (
isa => 'Str',
required => 1,
default => 'application/json',
);
parameter header_exclude => (
isa => 'HashRef',
default => sub {{}},
);
parameter
=> 10,
};
=over
=item content_type
By default the content type is set to "application/json"
=item header_exclude
Acts as a filter, will exclude any header information.
header_exclu
perform a POST request with REST::Consumer::post.
The data will the Content-Type of application/json by default.
=item Other supported HTTP methods
DELETE and PUT: delete(%params) and put(%param
irtex::API::Request);
use strict;
use constant URL => 'https://cavirtex.com/api2/ticker.json';
use constant ATTRIBUTES => qw(currencypair);
use constant REQUEST_TYPE => 'GET';
use constant