package EPFL::Net::ipv6Test;
use 5.006;
use strict;
use warnings;
use JSON;
use Readonly;
use LWP::UserAgent;
=head1 NAME
EPFL::Net::ipv6Test - Website IPv6 accessibility validator API
=head1 VER
'http://ipv6-test.com/json/webaaaa.php';
Readonly::Scalar my $WEB_SERVER => 'http://ipv6-test.com/json/webserver.php';
Readonly::Scalar my $WEB_DNS => 'http://ipv6-test.com/json/webdns.php';
Readon
);
my $response = p_getUrl( $ua, $url );
if ( $response->is_success ) {
my $struct = from_json( $response->decoded_content );
return $struct;
}
return;
}
=head2 p_createUserAgent
Ret
package NKTI::general::dbms::mysql;
use strict;
use warnings;
use DBI;
use JSON;
use Data::Dumper;
# Subroutine for Error Handling MySQL Connection :
# -------------------------------------
----------
This subroutine can read file database config PHP.
And output of subroutine in JSON Format and can used as
parameter database config in module L<NKTI::general::dbconnect>.
package NKTI::general::dbconnect_devel;
use strict;
use warnings;
use JSON;
use DBI;
# Subroutine for MySQL RDMS connection :
# --------------------------------------------------------------
# ----------------------------------------------------------------
my $db_config = decode_json($get_db_config);
my $db_user = $db_config->{'db_user'};
my $db_pass = $db_config->{'db_
package NKTI::general::file::read;
use strict;
use warnings;
use JSON;
use Data::Dumper;
# Create Constructor Module :
# ---------------------------------------------------------------------
----------------
# for IF $type == 'json' :
# ----------------------------------------------------------------
elsif ($type eq 'json') {
# -------------------------------
es :
# ----------------------------------------------------------------
$data = json_berkas($loc_files);
}
# Check IF $type == 'dbconf' :
# -------------------------
package NKTI::general::dbms::sqlite;
use strict;
use warnings;
use DBI;
use JSON;
use Data::Dumper;
# Subroutine for SQLite error Handling :
# ----------------------------------------------
return $copy;
},
as => $method,
});
}
}
sub TO_JSON {
my ($self) = @_;
return "$self";
}
############## PRIVATE METHODS BELOW #########
Struct (Ru)
Работа с perl-структурами данных
Scenario: HTTP->JSON->Struct
When HTTP-запрос "GET" отправлен на "https://fastapi.metacpan.or
umber-Definitions"
Given содержимое HTTP-ответа прочитано как JSON
Then элемент структуры данных "$.name" совпадает с "Test-
тать JSON из L<HTTP-ответа|Test::BDD::Cucumber::Definitions::HTTP::Ru>
в perl-структуру:
Given содержимое HTTP-ответа прочитано как JSON
=cut
JSON
Given qr/read http response content as JSON/, sub {
Struct->read_http_response_content_as_json();
};
# read file content as JSON
Given qr/read file content as JSON
/, sub {
Struct->read_file_content_as_json();
};
# read zip archive members as list
Given qr/read zip archive members as list/, sub {
Struct->read_zip_archive_membe
Elastijk;
use strict;
use warnings;
our $VERSION = "0.13";
use JSON ();
use URI::Escape qw(uri_escape_utf8);
use Hijk;
our $JSON = JSON->new->utf8;
sub _build_hijk_request_args {
my $args = $_[
| '9200',
path => $path,
head => [
'Content-Type' => 'application/json',
( (exists $args->{head}) ? (@{$args->{head}}) : ()),
],
$qs?( query
= {%{$_[0]}};
$arg->{body} = $JSON->encode( $arg->{body} );
}
my ($status, $res_body) = request_raw($arg);
$res_body = $res_body ? eval { $JSON->decode($res_body) } : undef;
re
la::Plugin::Meta::Contributors;
use Dist::Zilla::Plugin::MetaConfig;
use Dist::Zilla::Plugin::MetaJSON;
use Dist::Zilla::Plugin::MetaProvides::Package;
use Dist::Zilla::Plugin::MetaResources;
use Dist
dWeaver;
use Dist::Zilla::Plugin::Test::CPAN::Changes;
use Dist::Zilla::Plugin::Test::CPAN::Meta::JSON;
use Dist::Zilla::Plugin::Test::CleanNamespaces;
use Dist::Zilla::Plugin::Test::Compile;
use Dist
index => 1 } ],
qw(
Meta::Contributors
MetaConfig
MetaJSON
MetaYAML
),
);
}
sub _meta_resources {
my $self = shift;
my
trict;
use warnings;
use DDP ( show_unicode => 1 );
use Exporter qw(import);
use JSON::Path qw(jpath jpath1);
use JSON::XS;
use List::Util qw(any all);
use Test::BDD::Cucumber::Definitions qw(S :vali
use Try::Tiny;
our $VERSION = '0.41';
our @EXPORT_OK = qw(Struct);
# Enable JSONPath Embedded Perl Expressions
$JSON::Path::Safe = 0; ## no critic (Variables::ProhibitPackageVars)
## no critic
ntent_as_json {
my $self = shift;
S->{Struct} = __PACKAGE__;
# Clean data
S->{_Struct}->{data} = undef;
my $error;
S->{_Struct}->{data} = try {
decode_json( S->{HTT
("", map { $Elastijk::JSON->encode($_)."\n" } @{$args{body}});
my ($status,$res) = $self->request_raw(method => "POST", command => "_bulk", %args);
$res = $Elastijk::JSON->decode($res) if $res
::Response;
use JSON::PP;
use strict;
use warnings;
no warnings 'redefine';
our $VERSION = 0.01;
*LWP::UserAgent::post = sub {
my ($object,$url,$params) = @_;
my $json = do{ undef $/;
<DATA> };
my $coder = JSON::PP->new->ascii->pretty->allow_nonref;
my $perl = $coder->decode( $json );
my $from = $params->{from};
if ( $url =~ /get-balance/ ) {
$f
,$url,$params) = @_;
my $json = do{ undef $/; <DATA> };
my $coder = JSON::PP->new->ascii->pretty->allow_nonref;
my $perl = $coder->decode( $json );
my $from = $params->{fro
0;
use Moose;
use HTTP::Tiny;
use IO::Socket::SSL; # Necessary for https URLs on HTTP::Tiny.
use JSON::PP;
use Carp;
has access_token => (
is => 'ro',
isa => 'Str',
required =
ntent => encode_json($params)) : ()),
headers => {
'Content-Type' => 'application/json; charset=UTF-8',
'X-Accept' => 'application/json',
$self->_set_rate_limit($current);
$self->_set_total_rate_limit($total);
return decode_json($response->{content});
}
__PACKAGE__->meta->make_immutable;
no Moose;
1;
__END__
=pod
=enco
) = @_;
my $self = bless {}, $class;
$param{server} ||= 'https://rest.nexmo.com/sms/json';
for my $attr ( @attrs ) {
if ( exists $param{$attr} ) {
$self->$at
use Nexmo::SMS;
my $nexmo = Nexmo::SMS->new(
server => 'https://rest.nexmo.com/sms/json',
username => 'testuser1',
password => 'testpasswd2',
);
my $sms = $
eate a new object
my $foo = Nexmo::SMS->new(
server => 'https://rest.nexmo.com/sms/json',
username => 'testuser1',
password => 'testpasswd2',
);
Those parameters ar
package Nexmo::SMS::GetBalance;
use strict;
use warnings;
use LWP::UserAgent;
use JSON::PP;
# ABSTRACT: Module to ask for the balance for the Nexmo SMS API!
our $VERSION = '0.02';
my %attrs = (
ept' => 'application/json' );
my $response = $ua->get(
$url,
);
if ( !$response || !$response->is_success ) {
return;
}
my $json = $response->conten
t;
my $coder = JSON::PP->new->utf8->pretty->allow_nonref;
my $perl = $coder->decode( $json );
return if !$perl || ref $perl ne 'HASH';
return $perl->{'value'};
}
1;
__END_
se Authen::SASL::SASLprep 1.100 qw/saslprep/;
use JSON::MaybeXS;
use MIME::Base64 qw/encode_base64/;
use Tie::IxHash;
use Path::Tiny;
my $JSON = JSON::MaybeXS->new( ascii => 1, canonical => 1, pretty
",
map {
$_ > 127 # if above ASCII
? sprintf( "\\u%04x", $_ ) # JSON-style escapes
: chr($_) # else as themselves
} unpack( "W*
)
{
$thash{$k} = $cred->{$k};
}
my $fname = lc "$label.json";
$fname =~ tr[ ][-];
path($fname)->spew( $JSON->encode( \%thash ) );
}
}
S::WAPPushMessage;
use strict;
use warnings;
use Nexmo::SMS::Response;
use LWP::UserAgent;
use JSON::PP;
# ABSTRACT: Module that respresents a WAPPush message for the Nexmo SMS API!
our $VERSION
f $response;
return;
}
my $json = $response->content;
my $response_object = Nexmo::SMS::Response->new( json => $json );
if ( $response_object->is_error ) {
my $nexmo = Nexmo::SMS::WAPPushMessage->new(
server => 'http://rest.nexmo.com/sms/json',
username => 'testuser1',
password => 'testpasswd2',
text => 'This i
MS::BinaryMessage;
use strict;
use warnings;
use Nexmo::SMS::Response;
use LWP::UserAgent;
use JSON::PP;
# ABSTRACT: Module that respresents a binary message for the Nexmo SMS API!
our $VERSION =
f $response;
return;
}
my $json = $response->content;
my $response_object = Nexmo::SMS::Response->new( json => $json );
if ( $response_object->is_error ) {
;
my $nexmo = Nexmo::SMS::BinaryMessage->new(
server => 'http://rest.nexmo.com/sms/json',
username => 'testuser1',
password => 'testpasswd2',
text => 'This i