"Content-Type" => "application/json",
"X-Requested-With" => "Hijk",
]
Will produce these request headers:
Content-Type: application/json
X-Requested-With: Hijk
In additi
get '/' => sub {
my $c=shift;
app->ua->get_p('ifconfig.me/all.json')->then(sub {
$c->render(text=>shift->res->json('/ip_addr'));
});
};
=head1 METHODS
=head2 register
Sets up
}
$def;
}
# j=as json (except the last default)
sub _ifdefj {
require JSON::MaybeXS;
my $def = pop @_;
for (@_) {
return JSON::MaybeXS::decode_json($_) if defined($_);
utside the script using environment variable,
which is more flexible. Encode data structure using JSON:
% LOG_SHOW_CATEGORY=1 \
LOG_CATEGORY_ALIAS='{"-noisy":["Foo","Bar::Baz","Quz"]}' \
LOG_C
file for short, previously "flag file") will be searched
in <PROG>.log_options. Its content is in JSON and will become init() arguments.
For example:
{"file": 1, "screen":{"level":"trace"}}
or more
Huffman table in JSON format to C<$saved>.
This was added in version 0.04.
=head2 load
my $n = Compress::Huffman->new ();
$n->load ($saved);
Load a Huffman table in JSON format from C<$sa
stems are two
forms of encoding designed to overcome this issue.
=head1 DEPENDENCIES
L<JSON::Parse> and L<JSON::Create> are used by L</save> and L</load>
for storing the Huffman table. The module al
te"},{module=>"IO::Socket::SSL"},{module=>"Mojo::DOM"},{module=>"Mojo::DOM::CSS"},{module=>"Mojo::JSON"},{module=>"Mojo::Pg"},{module=>"Mojo::UserAgent"},{module=>"Mojolicious::Command::cgi"},{module=
e=>"Mojo::IOLoop"},{module=>"Mojo::JSON::Pointer"},{module=>"Mojo::UserAgent::Transactor"},{module=>"Mojolicious::Plugin::Config"},{module=>"Mojolicious::Plugin::JSONConfig"},{module=>"Test::Mojo"},{m
{module=>"Mojo::Asset::File"},{module=>"Mojo::IOLoop::Stream"},{module=>"Mojo::Loader"},{module=>"JSON::Validator"},{module=>"Mojolicious::Plugin::OpenAPI"},{module=>"Mojolicious::Routes::Route"},{mod
::Update;
use Moo::Role;
requires 'POST_JSON', 'uri_for';
sub update {
my ($self, $id, $json) = @_;
return $self->PATCH_JSON($self->uri_for($id), $json);
}
1;
=head1 NAME
WebService::Auth0::
ken {
my ($self, $params) = @_;
$params->{client_id} = $self->client_id;
return $self->POST_JSON($self->uri_for('oauth','access_token'), $params);
}
=head2 oauth_ro
POST $DOMAIN/oauth/ro
_ro {
my ($self, $params) = @_;
$params->{client_id} = $self->client_id;
return $self->POST_JSON($self->uri_for('oauth','ro'), $params);
}
=head2 logout
GET $DOMAIN/v2/logout
L<https://au
nup {
my ($self, $params) = @_;
$params->{client_id} = $self->client_id;
return $self->POST_JSON($self->uri_for('dbconnections','signup'), $params);
}
=head2 change_db_password
POST $DOMAI
es=>[{module=>"IO::Socket::SSL"},{module=>"Mojo::DOM"},{module=>"Mojo::DOM::CSS"},{module=>"Mojo::JSON"},{module=>"Mojo::Pg"},{module=>"Mojo::UserAgent"},{module=>"Mojolicious::Command::cgi"},{module=
ver
=item * L<IO::Socket::SSL>
=item * L<Mojo::DOM>
=item * L<Mojo::DOM::CSS>
=item * L<Mojo::JSON>
=item * L<Mojo::Pg>
=item * L<Mojo::UserAgent>
=item * L<Mojolicious::Command::cgi>
=item *
::Role::Create;
use Moo::Role;
requires 'POST_JSON', 'uri_for';
sub create {
my ($self, $json) = @_;
return $self->POST_JSON($self->uri_for, $json);
}
1;
=head1 NAME
WebService::Auth0::Manag
t;
use base 'Exporter';
use Outthentic::DSL;
use Outthentic::Story::Stat;
use File::ShareDir;
use JSON;
use Carp;
use Time::localtime;
use File::Path::Tiny;
use Term::ANSIColor;
our @EXPORT = qw{
out_file to read!";
my @out = <RUBY_HOOK_OUT>;
close RUBY_HOOK_OUT;
my $story_vars_json;
for my $l (@out) {
next if $l=~/#/;
quit($1) if $l=~/quit:(.*)/;
outth
l=~/ignore_story_err:\s+(\d)/;
if ($l=~s/story_var_json_begin.*// .. $l=~s/story_var_json_end.*//){
$story_vars_json.=$l;
next;
}
if ($l=~/story:\s+(\S+)
$VERSION = '0.4.7';
1;
package main;
use Carp;
use Config::General;
use YAML qw{LoadFile};
use JSON;
use Cwd;
use strict;
use Data::Dumper;
use File::Temp qw/ tempfile /;
use Outthentic::Story;
us
>> 8,$stdout.$stderr);
}
sub config {
$config_data
}
sub dump_config {
my $json = JSON->new->pretty;
print $json->encode(config());
}
sub nocolor {
get_prop('nocolor')
}
sub populate_confi
('json_file_path') and -f get_prop('json_file_path') ){
my $path = get_prop('json_file_path');
open DATA, $path or confess "can't open file $path to read: $!";
my $json_s
metadata=>$data});
}
sub link_account {
my ($self, $user_id, $data) = @_;
return $self->POST_JSON($self->uri_for($user_id), $data);
}
sub unlink_account {
my ($self, $user_id, $provider, $iden
ms) = @_;
return $self->POST_JSON($self->uri_for('email-verification'), $params);
}
sub create_password_change {
my ($self, $params) = @_;
return $self->POST_JSON($self->uri_for('password-chang
->GET($self->uri_for($params));
}
sub update {
my ($self, $params) = @_;
return $self->PATCH_JSON($self->uri_for(), $params);
}
=head1 NAME
WebService::Auth0::Management::Tenants - Users manage
::Perl;
1;
package main;
use glue;
use strict;
use JSON;
our $VARIABLES;
our $CAPTURES;
sub config {
my $path = cache_dir()."/config.json";
open CONF, $path or die "can't open file $path t
NF>;
close CONF;
my $json = JSON->new;
return $json->decode($data);
}
sub captures {
return $CAPTURES if $CAPTURES;
my $path = cache_dir()."/captures.json";
open CAPT, $path or di
open file $path to read: $!";
my $data = join '', <CAPT>;
close CAPT;
my $json = JSON->new;
$CAPTURES = $json->decode($data);
return $CAPTURES;
}
sub capture {
captures()->[0]
}
s
ors','sms','templates'));
}
sub update_templates {
my ($self, $body) = @_;
return $self->PUT_JSON($self->uri_for('factors','sms','templates'), $body);
}
sub providers_by_name {
my ($self, $fac
ta) = @_;
return $self->POST_JSON($self->uri_for('enrollments','ticket'),$data);
}
sub update_factor {
my ($self, $factor_name, $data) = @_;
return $self->PUT_JSON($self->uri_for('factor', $fac
tor_name), $data);
}
sub put_twilio {
my ($self, $data) = @_;
return $self->PUT_JSON($self->uri_for('factor', 'sms', 'providers', 'twilo'), $data);
}
=head1 NAME
WebService::Auth0::Management::
package WebService::Auth0::UA::LWP;
use Moo;
use LWP::UserAgent;
use JSON::MaybeXS;
use Future;
has options => (is=>'ro', required=>1, default=>sub { +{} });
has ua => (
is=>'ro',
lazy=>1,
req
esponse = $self->ua->request($request);
my $json_err;
my $data = do {
# Required because I often see 204 no content but with
# application/json as the content type
if($response->code =
/json' ?
decode_json($response->decoded_content) :
$response;
} || do {
$json_err = $@;
};
}
};
if($json_err) {
return Future->fail(
$json
package WebService::Auth0::Management::Base;
use Moo;
use URI;
use HTTP::Request::Common ();
use JSON::MaybeXS ();
has domain => (
is=>'ro',
required=>1 );
has token => (
is=>'ro',
required
)) }
sub encode_json { shift; JSON::MaybeXS::encode_json(shift) }
sub POST_JSON {
my ($self, $uri, $json) = @_;
return $self->POST( $uri,
'content-type' => 'application/json',
Content =>
_json($json));
}
sub PUT_JSON {
my ($self, $uri, $json) = @_;
return $self->PUT( $uri,
'content-type' => 'application/json',
Content => $self->encode_json($json));
}
sub PATCH_JSON {
m
tream"},{module=>"Mojo::Collection"},{module=>"Mojo::DOM"},{module=>"Mojo::File"},{module=>"Mojo::JSON"},{module=>"Mojo::Message::Response"},{module=>"Mojo::UserAgent"},{module=>"Mojo::Util"},{module=
tream>
=item * L<Mojo::Collection>
=item * L<Mojo::DOM>
=item * L<Mojo::File>
=item * L<Mojo::JSON>
=item * L<Mojo::Message::Response>
=item * L<Mojo::UserAgent>
=item * L<Mojo::Util>
=item *
package Outthentic::Glue::Bash;
use base 'Exporter';
use JSON;
use strict;
our @EXPORT = qw{
json_var
};
sub json_var {
my $path = $ARGV[0];
my $name = $ARGV[1];
open CONF, $path or die "
pen file $path to read: $!";
my $data = join "", <CONF>;
close CONF;
my $json = JSON->new;
my $conf = $json->decode($data);
for my $n (split /\./, $name){
$conf = $conf->{$n};