Group
Extension

Matches 2

MooX-Role-HTTP-Tiny ( A/AB/ABELTJE/MooX-Role-HTTP-Tiny-0.94.tar.gz, ABELTJE, 2023; MetaCPAN )
MooX-Role-HTTP-Tiny/lib/MooX/Role/REST.pm ( view source; MetaCPAN )
idators
>;

use JSON;
use Types::Standard qw< Enum HashRef InstanceOf Maybe Str >;

our $VERSION = '0.001';
our $DEBUG = 0;

=head1 NAME

MooX::Role::REST - Simple HTTP client for JSON-REST as a Moo::
s::CompiledValidators'));

=head1 DESCRIPTION

Helper role to implement a simple REST client with JSON.

=head2 call

Mandatory method that implements the actual HTTP stuff.

=cut

sub call {
    my $
ndpoint->query($params) if $params;
    }
    else {
        @body = $cdata ? { content => encode_json($cdata) } : ();
    }

    print STDERR ">>>$hmethod($endpoint)>>>@body<<<\n"
        if $DEBUG;
MooX-Role-HTTP-Tiny ( A/AB/ABELTJE/MooX-Role-HTTP-Tiny-0.94.tar.gz, ABELTJE, 2023; MetaCPAN )
MooX-Role-HTTP-Tiny/lib/MooX/Role/HTTP/Tiny.pm ( view source; MetaCPAN )
PSIS

    package My::Client;
    use Moo;
    with qw< MooX::Role::HTTP::Tiny >;
    use JSON qw< encode_json >;

    # implent a call to the API of a webservice
    sub call {
        my $self = shi
i->path . $path : $path)
            if $path;

        my @params = $args ? ({ content => encode_json($args) }) : ();
        if (uc($method) eq 'GET') {
            my $query = $self->www_form_urlen
 webservice that uses the HTTP(S)
transport protocol.

Some best known protocols are I<XMLRPC>, I<JSONRPC> and I<REST>, and can be
implemented through the required C<call()> method.

=cut

sub _build_

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.