ackage Net::Riak::Role::PBC::Object;
{
$Net::Riak::Role::PBC::Object::VERSION = '0.1702';
}
use JSON;
use Moose::Role;
use List::Util 'first';
sub store_object {
my ($self, $w, $dw, $object) =
ey;
my $value = (ref $object->data && $object->content_type eq 'application/json')
? JSON::encode_json($object->data) : $object->data;
my $content = {
content_type => $ob
$content->usermeta);
}
my $data = ($object->content_type eq 'application/json')
? JSON::decode_json($content->value) : $content->value;
$object->exists(1);
$object->data($d
le::REST::Bucket;
{
$Net::Riak::Role::REST::Bucket::VERSION = '0.1702';
}
use Moose::Role;
use JSON;
sub get_properties {
my ($self, $name, $params) = @_;
# Callbacks require stream mode
urn JSON::decode_json($response->content);
}
# In streaming mode, aggregate keys from the multiple returned chunk objects
else {
my $json = JSON->new;
my $props = $json->i
ncr_parse($response->content);
if ($params->{cb}) {
while (defined(my $obj = $json->incr_parse)) {
$params->{cb}->($_) foreach @{$obj->{keys}};
}
::Light;
{
$Device::Hue::Light::VERSION = '0.4';
}
use common::sense;
use Class::Accessor;
use JSON::XS;
use Hash::Merge::Simple qw/ merge /;
use Data::Dumper;
use base qw(Class::Accessor);
__PAC
(exists $param->{'on'}) {
$param->{'on'} = (defined $param->{'on'} && $param->{'on'}) ? JSON::XS::true : JSON::XS::false;
}
$self->merge_param($param);
if ($self->_trx) {
} else {
# say Dumpe
rvice::Flattr;
{
$WebService::Flattr::VERSION = '0.55';
}
use strict;
use warnings;
use JSON 'decode_json';
use LWP::UserAgent ();
use URI ();
use URI::QueryParam ();
use URI::Template ();
use Web
, Accept => 'application/json');
if ($resp->is_error) {
die $resp->status_line;
}
return WebService::Flattr::Response->_new({
data => decode_json $resp->content,
ding. RedOxygen uses custom message formats and response codes and can't just
be used via simple JSON POST calls.
To use this driver you must have a RedOxygen account, either a trial or full accou
use base qw(Bot::BasicBot::Pluggable::Module);
use 5.010;
use LWP::Simple qw($ua);
use JSON qw( decode_json );
sub init {
my $self = shift;
$self->get( 'user_field_not_set' ) || $self->set( us
LE TESTING_DONE.};
}
sub _get_rb_data {
my ($self, $rb) = @_;
$self->ua;
my $content = decode_json LWP::Simple::get( sprintf( "%s/api/review-requests/%d", $self->get('user_rb_url'), $rb ) );
my $
package AnyEvent::Lingr;
use Mouse;
our $VERSION = '0.07';
use AnyEvent::HTTP;
use Carp;
use JSON;
use Log::Minimal;
use Scalar::Util ();
use Try::Tiny;
use URI;
has ['user', 'password'] => (
ms);
my $cb_wrap = sub {
my ($body, $hdr) = @_;
my $json = try { decode_json $body };
$cb->($json, $hdr);
};
if ($http_method eq 'GET') {
http_get $uri,
sub {
my ($body, $hdr) = @_;
return unless $self;
my $res = try { decode_json $body };
if ($res and $res->{status} eq 'ok') {
if ($res->{counter}) {
buckets.. are you running riak 0.14+?"
unless $response->is_success;
my $resp = JSON::decode_json($response->content);
return ref ($resp->{buckets}) eq 'ARRAY' ? @{$resp->{buckets}} :
new_request('GET', ["stats"]);
my $response = $self->send_request($request);
return JSON::decode_json($response->content);
}
1;
__END__
=pod
=head1 NAME
Net::Riak::Role::REST - role for R
use 5.006;
use strict;
use warnings;
use Carp;
use LWP::UserAgent;
use URI;
use JSON qw(decode_json);
use Data::Dumper;
use HTTP::Headers;
use Scalar::Util qw(reftype);
# declare doma
'access_token' => 'oauth2/token'
);
our %formats = (
'*' => '*/*',
'json' => 'application/json',
'xml' => 'application/xml'
);
our $VERSION = '0.04';
=pod
=head1 NAME
# OAuth Dance is completed :-) Have fun now.
# Default request and response formats are 'json'
# a GET request '/me' - gets users details
my $user = $scloud->get('/me');
nse;
{
$SeeAlso::Response::VERSION = '0.71';
}
#ABSTRACT: SeeAlso Simple Response
use JSON::XS qw(encode_json);
use Data::Validate::URI qw(is_uri);
use Text::CSV;
use SeeAlso::Identifier;
use Carp;
);
}
sub uris {
my $self = shift;
return @{ $self->{uris} };
}
sub toJSON {
my ($self, $callback, $json) = @_;
my $response = [
$self->{query}->as_string,
$self->{
return _JSON( $response, $callback, $json );
}
sub as_string {
return $_[0]->toJSON;
}
sub fromJSON {
my ($self, $jsonstring) = @_;
my $json = JSON::XS->new->decode($jsonstring);
le::REST::Object;
{
$Net::Riak::Role::REST::Object::VERSION = '0.1702';
}
use Moose::Role;
use JSON;
sub store_object {
my ($self, $w, $dw, $object) = @_;
my $params = {returnbody => 'tru
}
if (ref $object->data && $object->content_type eq 'application/json') {
$request->content(JSON::encode_json($object->data));
}
else {
$request->content($object->data
if $http_response->content_type;
$obj->data(JSON::decode_json($obj->data))
if $obj->content_type eq 'application/json';
$obj->vclock($http_response->header('X-Riak-Vc
;
}
use Moose;
use JSON;
has bucket => (is => 'ro', isa => 'Str', required => 1);
has tag => (is => 'ro', isa => 'Str', required => 1);
has keep => (is => 'rw', isa => 'JSON::Boolean', required
content_type => (is => 'rw', isa => 'Str', default => 'application/json');
has location => (is => 'rw', isa => 'Str');
has _jsonize => (is => 'rw', isa => 'Bool', lazy => 1, default => 1);
ha
package Net::PayPal;
# $Id$
use 5.005;
use strict;
use JSON;
use LWP;
use Crypt::CBC;
use Carp ("croak");
use Cache::FileCache;
our $VERSION = '0.02';
our $ENDPOINT_SANDBOX = "https:
ser_agent};
my $h = HTTP::Headers->new(
Accept => "application/json",
'Accept-Language' => 'en_US'
);
$h->authorization_basic( $args
tion failed : " . $res->status_line . ', ' . $res->content;
}
my $res_hash = _json_decode( $res->content );
$args{access_token} = $res_hash->{access_token};
$ar
$self->ua->request( $req );
if ( $res->code == 200 ) {
my $data = $self->_decode( type => 'json', data => $res->content );
$data->{expires_at} = time + $data->{expires_in};
$self->merge_c
Nakanobu;
use strict;
use warnings;
use base qw/Class::Component::Plugin/;
use JSON::RPC::Common::Marshal::HTTP;
use JSON::RPC::Common::Procedure::Call;
use YAML ();
use LWP::UserAgent;
use Text::Trun
my ($method, $params, $entry_url, $timeout) = @_;
my $marshal = JSON::RPC::Common::Marshal::HTTP->new();
my $call = JSON::RPC::Common::Procedure::Call->new(
method => $method,
' => bless( do{\(my $o = 1)}, 'JSON::Boolean' ),
'owner' => 'c9s',
'has_issues' => bless( do{\(my $o = 0)}, 'JSON::Boolean' ),
ar @$running_tasks > 0) {
$self->render(json => { message => (scalar @$running_tasks) . " Tasks Running" });
}
else {
$self->render(json => { message => "All Quiet"} );
}
}
1;
$req->content ) {
my $json = $self->_encode( type => 'json', data => $data );
$req->content( $json );
$req->headers->header( 'Content-Type' => 'application/json; charset=utf-8' );
#
Uncomment this to view generated JSON content.
# $self->debug( $json );
}
}
, m_scheme => $scheme
, m_host => $host
, m_path_match => qr/^\Q$path\E/
);
# Add response wrapper.
$self
( $res, $ua, $h ) = @_;
if ( my $data = $res->content ) {
$data = $self->_decode( type => 'json', data => $data );
$res->content( $data );
}
}
, m_scheme => $scheme
, m_host => $ho
> $servers,
userid => 1,
});
$self->app->log->debug("Got jobid: $jobid");
$self->render(json => { jobid => $jobid, status => "starting task: $task_name" });
$self->app->log->debug("After r