taCPAN
$MetaCPAN::Client::Request::VERSION = '2.033000';
use Moo;
use Carp;
use JSON::MaybeXS qw<decode_json encode_json>;
use Ref::Util qw< is_arrayref is_hashref is_ref >;
use MetaCPAN::Client::Scr
val {
$info = $self->ua->get( 'https://clientinfo.metacpan.org' );
$info = decode_json( $info->{content} );
is_hashref($info) and exists $info->{production} or die;
1;
$self->ua;
my $result = keys %{$params}
? $ua->post( $req_url, { content => encode_json $params } )
: $ua->get($req_url);
return $self->_decode_result( $result, $req_url );
for MetaCPAN entities
$MetaCPAN::Client::Role::Entity::VERSION = '2.033000';
use Moo::Role;
use JSON::PP;
use Ref::Util qw< is_ref is_arrayref is_hashref >;
has data => (
is => 'ro',
$k}->[0]
if is_arrayref( $args{data}{$k} ) and @{$args{data}{$k}} == 1;
if ( JSON::PP::is_bool($args{data}{$k}) ) {
$args{data}{$k} = !!$args{data}{$k};
}
l::VERSION = '2.033000';
use Moo;
use Carp;
use Ref::Util qw< is_hashref >;
use JSON::MaybeXS qw< decode_json encode_json >;
use MetaCPAN::Client::Types qw< Str Int Time ArrayRef HashRef Bool >;
has
'%s/%s/_search?scroll=%s&size=%s', $base_url, $type, $time, $size ),
{ content => encode_json $body }
);
if ( $res->{status} != 200 ) {
my $msg = "failed to create a scrolled
g} and $msg .= "\n(" . $res->{content} . ")";
croak $msg;
}
my $content = decode_json $res->{content};
# read response content --> object params
$args{_id} = $content->{
::Client::Release::VERSION = '2.033000';
use Moo;
use Ref::Util qw< is_hashref >;
use JSON::MaybeXS qw< decode_json >;
with 'MetaCPAN::Client::Role::Entity',
'MetaCPAN::Client::Role::HasUA';
my
my $res = $self->ua->get($url);
return unless is_hashref($res);
my $content = decode_json $res->{'content'};
return $content->{'content'};
}
sub metacpan_url {
my $self = shift;
my $res = $self->ua->get($url);
return unless is_hashref($res);
my $content = decode_json $res->{'content'};
return $content->{'contributors'};
}
1;
__END__
=pod
=encoding UTF-8