my $neko1 = { 'name' => $httpd->name, 'version' => $Haineko::VERSION };
return $httpd->res->json( 200, $neko1 );
}
sub info {
# GET /dump, /conf
my $class = shift;
my $httpd = shift
00, Data::Dumper::Dumper $httpd );
} else {
# /conf
use Haineko::JSON;
use File::Basename;
if( defined $ENV{'HAINEKO_CONF'} ) {
$configdata->{ $h }->{'path'} = $g;
$configdata->{ $h }->{'data'} = Haineko::JSON->loadfile( $g );
next unless $h eq 'authinfo';
for my $i
File::Slurp>
=item * L<File::Which|File::Which>
=item * L<Hash::Merge|Hash::Merge>
=item * L<JSON|JSON>
=item * L<List::MoreUtils|List::MoreUtils>
=item * L<Module::Build|Module::Build>, 0.35
=i
kage MojoX::JSON::XS;
use Mojo::Base 'Mojolicious::Plugin';
use strict;
use Mojo::Util qw(monkey_patch);
use JSON::XS;
our $VERSION = "0.01";
sub register
{
monkey_patch "Mojo::JSON", encode =
urn encode_json( $_[1] ); };
monkey_patch "Mojo::JSON", decode => sub { return decode_json( $_[1] ); };
monkey_patch "Mojo::JSON", j => sub { if(ref $_[0]) { return encode_json( $_[0] );
else { return decode_json( $_[0] ); }
};
}
1;
=encoding utf8
=head1 NAME
MojoX::JSON::XS - A JSON::XS backend replacement for Mojo::JSON
=head1 SYNOPSIS
sub startup
md', { title => 'My Project' });
=head1 DESCRIPTION
B<WWW::GoodData> is the client for GoodData JSON-based API
built atop L<WWW::GoodData::Agent> client agent, with focus
on usefullness and correctn
per funcitons for common actions.
=cut
use strict;
use warnings;
use WWW::GoodData::Agent;
use JSON;
use URI;
our $VERSION = '1.11';
our $root = new URI ('https://secure.gooddata.com/gdc');
=head
shift;
my $project = shift;
my $file = shift;
# Parse the manifest
my $upload_info = decode_json (slurp_file ($file));
die "$file: not a SLI manifest"
unless $upload_info->{dataSetSLIManifest
TTPD;
use feature ':5.10';
use strict;
use warnings;
use Try::Tiny;
use Path::Class;
use Haineko::JSON;
use Haineko::Default;
use Class::Accessor::Lite;
use Haineko::HTTPD::Router;
use Haineko::HTTPD:
->{'root'} = Path::Class::Dir->new( $hainekodir ) if $hainekodir;
$argvs->{'conf'} = Haineko::JSON->loadfile( $hainekocfg ) || Haineko::Default->conf;
$milterlibs = $argvs->{'conf'}->{'smtpd'}
as a JSON.
require Haineko::SMTPD::Response;
$mesg = Haineko::SMTPD::Response->r( 'http', 'not-found' )->damn;
}
if( ref $mesg eq 'HASH' ) {
# Respond as a JSON
http://127.0.0.1:2794/submit
=head2 PARAMETERS
To send email via Haineko, POST email data as a JSON format like the following:
{
ehlo: 'your-host-name.as.fqdn'
mail: 'kijitora
ype: application/json' \
-d '{ ehlo: "[127.0.0.1]", mail: "kijitora@example.jp", ... }'
OR
$ curl 'http://127.0.0.1:2794/submit' -X POST -H 'Content-Type application/json' \
-d '
.1:2794/conf
C</conf> can be accessed from 127.0.0.1 and display Haineko configuration data as a
JSON.
=head1 ENVIRONMENT VARIABLES
=head2 C<HAINEKO_ROOT>
Haineko decides the root directory by C<H
dsn is 5.6.0
in this method.
=head4 C<B<EMAIL_BODY>>
Value defined in "body" field in HTTP POST JSON data.
=head1 SEE ALSO
https://www.milter.org/developers/api/
=head1 REPOSITORY
https://github
'charset' => 'UTF-8',
},
},
];
return $httpd->res->json( 200, Haineko::JSON->dumpjson( $samplemail ) );
}
1;
__END__
=encoding utf-8
=head1 NAME
Haineko::Sample - Co
ample email
=head1 DESCRIPTION
Haineko::Sample is a controller for displaying email sample as a JSON.
=head2 URL
http://127.0.0.1:2794/sample/mail
=head1 REPOSITORY
https://github.com/azumak
ngs;
use Encode;
use Try::Tiny;
use Time::Piece;
use Scalar::Util;
use Haineko::Log;
use Haineko::JSON;
use Haineko::Default;
use Haineko::SMTPD::Milter;
use Haineko::SMTPD::Session;
use Haineko::SMTP
$responsecn = 'Haineko::SMTPD::Response';
my $responsejk = 'response'; # (String) Response json key name
my $exceptions = 0; # (Integer) Flag, be set in try {...} catch { ... }
( $esresponse );
$nekosyslog->w( 'err', $esresponse->damn );
return $httpd->res->json( 405, $tmpsession->damn );
}
CONN: {
# ____ ___ _ _ _ _
# / ___
longing to the
cluster which execute the $cluster_name tasks.
Input:
- none
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
er_name - String value to uniquely identify a task in the ZooKeeper
cluster
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
er_name - String value to uniquely identify a task in the ZooKeeper
cluster
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
er_name - String value to uniquely identify a task in the ZooKeeper
cluster
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
;
BEGIN { extends 'Catalyst::Controller' };
with 'CatalystX::Controller::ExtJS::Direct';
use JSON::XS;
sub add : Chained('/') : Path : CaptureArgs(1) {
my($self,$c, $arg) = @_;
$c->stas
: DirectArgs(1) {
my ($self, $c) = @_;
$c->res->content_type('application/json');
$c->res->body(encode_json($c->req->data));
}
As you can see the C<add_to> action has the C<Direct> attri
which is always an arrayref and includes all arguments.
We set the content type to C<application/json> to make sure that the
body is not serialized twice. That is, if you would not set the content ty
er_name - String value to uniquely identify a task in the ZooKeeper
cluster
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
MPRPC::Client instance
sub get_client {
my ($self) = @_;
return $self->{client};
}
# Get JSON configure data from Jubatus server
sub get_config {
my ($self) = @_;
my $retval = $self->
[],
[],);
return $retval;
}
# Get JSON status data from Jubatus server
sub get_status {
my ($self) = @_;
my $retval = $self->_ca
t::Common;
use JSON;
use lib qw(t/lib);
use Test::WWW::Mechanize::Catalyst 'MyApp';
my $mech = Test::WWW::Mechanize::Catalyst->new();
$mech->add_header('Accept' => 'application/json');
$mech->get
$json = JSON::decode_json($mech->content), 'response is JSON response');
is($json->{results}, 0, 'no results');
my $res = $mech->request(POST '/user', [name => 'bar', password => 'foo']);
ok($json
= JSON::decode_json($res->content), 'response is JSON response');
is($json->{success}, 'true', 'submission was successful');
is($res->header('location'), 'http://localhost/user/1', 'user location is
er_name - String value to uniquely identify a task in the ZooKeeper
cluster
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is
CT: Sets the request method via a query parameter
use Moose::Role;
use namespace::autoclean;
use JSON::XS;
#has 'is_ext_upload' => ( isa => 'Bool', is => 'rw', lazy_build => 1 );
sub is_ext_upload
^multipart\/form-data/
&& ( !$self->{content_type} || $self->{content_type} ne 'application/json');
}
around 'method' => sub {
my ( $orig, $self, $method ) = @_;
return $self->$orig($me
er_name - String value to uniquely identify a task in the ZooKeeper
cluster
Output:
- JSON file formated string - Returns a server configuration from a server.
This configuration is