sub TO_JSON {
my ($self) = @_;
my $json = {
mimeType => $self->mime_type(),
size => $self->size(),
};
if ( defined $self->compression() ) {
$json->{compre
{
$json->{text} = $self->text();
}
if ( defined $self->encoding() ) {
$json->{encoding} = $self->encoding();
}
if ( defined $self->comment() ) {
$json->{comment
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Entry::Response::Content
re"
);
}
return $old;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
if ( defined $self->before_request() ) {
$json->{beforeRequest} = $self->before_request();
elsif ( exists $self->{beforeRequest} ) {
$json->{beforeRequest} = undef;
}
if ( defined $self->after_request() ) {
$json->{afterRequest} = $self->after_request();
}
} ) {
$json->{afterRequest} = undef;
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comment();
}
foreach my $key ( sort { $a cmp $b } keys %{$self} ) {
old;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
$json->{name} = $self->name();
$json->{value} = $self->value();
if ( defined $self->comment() ) {
$json->{comment} =
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Entry::Header - Represent
se utf8;
package Amon2::Auth::Site::Github;
use Mouse;
use Amon2::Auth;
use LWP::UserAgent;
use JSON;
use Amon2::Auth::Util qw(parse_content);
our $VERSION = '0.07';
sub moniker { 'github' }
has c
$res->is_success or return $callback->{on_error}->($res->status_line);
my $dat = decode_json($res->decoded_content);
push @args, $dat;
}
return $callback->{on_finished}->( @args
_JSON {
my ($self) = @_;
my $json = {};
$json->{status} = $self->status();
$json->{statusText} = $self->status_text();
$json->{httpVersion} = $self->http_version();
$json
$json->{headers} = [ $self->headers() ];
$json->{content} = $self->content();
$json->{redirectURL} = $self->redirect_url();
if ( defined $self->headers_size() ) {
$json->
$json->{headersSize} = _DOES_NOT_APPLY();
}
$json->{headersSize} += 0;
if ( defined $self->body_size() ) {
$json->{bodySize} = $self->body_size();
}
else {
$json->
return $old;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
if ( defined $self->name() ) {
$json->{name} = $self->name();
}
else {
$json->{name} = 'Unknown';
f->version() ) {
$json->{version} = $self->version();
}
else {
$json->{version} = 'Unknown';
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comme
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Creator - Represents the
sub TO_JSON {
my ($self) = @_;
my $json = {};
if ( defined $self->expires() ) {
$json->{expires} = $self->expires();
}
if ( $self->last_access() ) {
$json->{lastA
$json->{lastAccess} = '0000-00-00T00-00-00';
}
$json->{eTag} = $self->etag();
$json->{hitCount} = $self->hit_count();
if ( defined $self->comment() ) {
$json->{comme
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Entry::Cache::Request - R
sub TO_JSON {
my ($self) = @_;
my $json = {};
if ( defined $self->on_content_load() ) {
$json->{onContentLoad} = $self->on_content_load();
}
else {
$json->{onCont
on_load() ) {
$json->{onLoad} = $self->on_load();
}
else {
$json->{onLoad} = _DOES_NOT_APPLY();
}
if ( defined $self->comment() ) {
$json->{comment} = $self->co
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Page::PageTimings - Repre
ive::Har::Entry();
use XML::LibXML();
use IO::Compress::Gzip();
use IO::Uncompress::Gunzip();
use JSON();
use overload '""' => 'string';
our $VERSION = '0.21';
sub new {
my ( $class, $params ) =
ring($string);
}
return $old;
}
sub hashref {
my ( $self, $ref ) = @_;
my $old = JSON->new()->utf8()->decode( $self->string() );
if ( ( @_ > 1 ) && ( defined $ref ) ) {
$s
;
}
my $json = JSON->new();
$json = $json->utf8();
$json = $json->allow_blessed(1);
$json = $json->convert_blessed(1);
$json = $json->pretty();
$json = $json->canonical(1);
TO_JSON {
my ($self) = @_;
my $json = {};
$json->{name} = $self->name();
if ( !defined $json->{name} ) {
$json->{name} = q[]; # HAR Viewer insists on this
}
$json->{
value} = $self->value();
if ( defined $self->comment() ) {
$json->{comment} = $self->comment();
}
foreach my $key ( sort { $a cmp $b } keys %{$self} ) {
next if ( !defined
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__DATA__
=head1 NAME
Archive::Har::Entry::Request::QueryStr
sub TO_JSON {
my ($self) = @_;
my $json = {};
$json->{mimeType} = $self->mime_type();
$json->{params} = [ $self->params() ];
if ( defined $self->text() ) {
$json->{text}
= $self->text();
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comment();
}
foreach my $key ( sort { $a cmp $b } keys %{$self} ) {
next if ( !defined $
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Entry::Request::PostData
package Archive::Har::Entry::Cookie;
use warnings;
use strict;
use JSON();
use Carp();
our $VERSION = '0.21';
sub new {
my ( $class, $params ) = @_;
my $self = {};
bless $self, $class;
$old;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
$json->{name} = $self->name();
$json->{value} = $self->value();
if ( defined $self->path() ) {
$json->{path} = $self
$json->{domain} = $self->domain();
}
if ( defined $self->expires() ) {
$json->{expires} = $self->expires();
}
if ( defined $self->http_only() ) {
$json->{httpOn
return $old;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
if ( defined $self->name() ) {
$json->{name} = $self->name();
}
else {
$json->{name} = 'Unknown';
f->version() ) {
$json->{version} = $self->version();
}
else {
$json->{version} = 'Unknown';
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comme
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Browser - Represents the
TO_JSON {
my ($self) = @_;
my $json = { pageTimings => $self->page_timings(), };
if ( defined $self->title() ) {
$json->{title} = $self->title();
}
else {
$json->{
$json->{startedDateTime} = $self->started_date_time();
}
else {
$json->{startedDateTime} = '0000-00-00T00:00:00.0+00:00';
}
if ( defined $self->id() ) {
$json->{id
} = $self->id();
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comment();
}
foreach my $key ( sort { $a cmp $b } keys %{$self} ) {
next if ( !defined $s
O_JSON {
my ($self) = @_;
my $json = {};
if ( defined $self->pageref() ) {
$json->{pageref} = $self->pageref();
}
if ( defined $self->started_date_time() ) {
$json-
$json->{startedDateTime} = '0000-00-00T00:00:00.0+00:00';
}
$json->{time} = $self->time();
$json->{request} = $self->request();
$json->{response} = $self->response();
$json->
{cache} = $self->cache();
$json->{timings} = $self->timings();
if ( defined $self->server_ip_address() ) {
$json->{serverIPAddress} = $self->server_ip_address();
}
if ( def
ld;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
$json->{name} = $self->name();
$json->{value} = $self->value();
if ( defined $self->file_name() ) {
$json->{fileName}
if ( defined $self->content_type() ) {
$json->{contentType} = $self->content_type();
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comment();
}
foreach
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Entry::Request::PostData:
@parts,
],
);
}
# XXX Email::MIME::Kit reads the manifest.json file as latin1
# fix this in a better way once that is fixed?
my $subject = $email->heade
>.json> to generate its associated email. If no language
is given, the regular C<manifest.json> will be used instead.
If C<emk_bulk> is used, it'll look in the I<kit> directory for a
C<targets.json>
file, which it'll use to create the email targets.
The format of the C<targets.json> file is a simple serialization of
the L<Email::MIME::Kit::Bulk::Target> constructor arguments:
[
{
s;
use MooseX::App::Simple;
use Email::MIME::Kit::Bulk;
use Email::MIME::Kit::Bulk::Target;
use JSON;
use MooseX::Types::Path::Tiny qw/ Path /;
use PerlX::Maybe;
option kit => (
is => 'ro
=> 'ro',
isa => Path,
lazy => 1,
default => sub { shift->kit->child('targets.json') },
);
sub BUILD {
my $self = shift;
die 'Kit directory must have a manifest'
rep {
my $f = $_->basename;
$f =~ /^manifest\./ && $f =~ /\.json$/
} $self->kit->children;
die 'Cannot find target specification (' . $self->_
{
my ($self, $map) = @_;
$map //= {
'text/html' => 'html',
'application/json' => 'json',
'text/xml' => 'xml',
'application/xml' => 'xml',
};
die "invalid typ
rvices.
=head1 SYNOPSIS
use Wurm qw(mob let);
use Wurm::Grub::REST;
use Data::UUID;
use JSON::XS;
use Tenjin;
my $grub = Wurm::Grub::REST->new
->get(
sub {
my $meal = shift;
json}
? to_json($meal)
: to_html($meal, 'item.html')
;
},
sub {
my $meal = shift;
$meal->grit->{items} = $meal->mind->{meld};
return $meal->vent->{json
::Kit::Bulk::ManifestReader::JSON;
use Moose;
extends 'Email::MIME::Kit';
has '+_manifest_reader_seed' => (
default => '=Email::MIME::Kit::Bulk::ManifestReader::JSON',
);
has language => (
::Kit>. It defaults the C<manifest_reader>
attribute to L<Email::MIME::Kit::Bulk::ManifestReader::JSON>, and add a new
C<language> attribute.
=head1 AUTHORS
=over 4
=item *
Jesse Luehrs <doy@c