API-CLI

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

    file: lib/API/CLI/Cmd.pm
    version: '0.001'
  API::CLI::Request:
    file: lib/API/CLI/Request.pm
    version: '0.001'
requires:
  App::AppSpec: '0'
  App::Spec: '0'
  App::Spec::Run::Cmd: '0'
  File::Share: '0'
  HTTP::Request: '0'
  JSON::XS: '0'
  LWP::UserAgent: '0'
  Moo: '0'
  URI: '0'
  YAML::XS: '0'
  base: '0'
  feature: '0'
  perl: '5.010'
  strict: '0'
  warnings: '0'

Makefile.PL  view on Meta::CPAN

    "bin/apicli"
  ],
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.010",
  "NAME" => "API::CLI",
  "PREREQ_PM" => {
    "App::AppSpec" => 0,
    "App::Spec" => 0,
    "App::Spec::Run::Cmd" => 0,
    "File::Share" => 0,
    "HTTP::Request" => 0,
    "JSON::XS" => 0,
    "LWP::UserAgent" => 0,
    "Moo" => 0,
    "URI" => 0,
    "YAML::XS" => 0,
    "base" => 0,
    "feature" => 0,
    "strict" => 0,
    "warnings" => 0
  },

Makefile.PL  view on Meta::CPAN

  }
);


my %FallbackPrereqs = (
  "App::AppSpec" => 0,
  "App::Spec" => 0,
  "App::Spec::Run::Cmd" => 0,
  "File::Share" => 0,
  "File::Spec" => 0,
  "HTTP::Request" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "JSON::XS" => 0,
  "LWP::UserAgent" => 0,
  "Moo" => 0,
  "Test::More" => 0,
  "URI" => 0,
  "YAML::XS" => 0,
  "base" => 0,
  "blib" => "1.01",

lib/API/CLI.pm  view on Meta::CPAN

use 5.010;
package API::CLI;

our $VERSION = '0.001'; # VERSION

use base 'App::Spec::Run::Cmd';

use URI;
use YAML::XS ();
use LWP::UserAgent;
use HTTP::Request;
use App::Spec;
use JSON::XS;
use API::CLI::Request;

use Moo;

has dir => ( is => 'ro' );
has openapi => ( is => 'ro' );

sub add_auth {

lib/API/CLI/Request.pm  view on Meta::CPAN

    my %query;
    for my $name (sort keys %$opt) {
        my $value = $opt->{ $name };
        if ($name =~ s/^q-//) {
            $query{ $name } = $value;
        }
    }
    $url->query_form(%query);
    $self->url($url);

    my $req = HTTP::Request->new( $self->method => $self->url );
    $self->req($req);

    return $self;
}

sub request {
    my ($self) = @_;

    my $ua = LWP::UserAgent->new;
    my $req = $self->req;



( run in 0.512 second using v1.01-cache-2.11-cpan-de7293f3b23 )