API-CLI

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

    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'
resources:

Makefile.PL  view on Meta::CPAN

  ],
  "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
  },
  "TEST_REQUIRES" => {

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

    my $content = $res->decoded_content;
    my $status = $res->status_line;

    my $ct = $res->content_type;
    my $out = $self->verbose ? "Response: $status ($ct)\n" : undef;
    my $data;
    my $ok = 0;
    if ($res->is_success) {
        $ok = 1;
        if ($ct eq 'application/json') {
            my $coder = JSON::XS->new->ascii->pretty->allow_nonref;
            $data = $coder->decode($content);
            $content = $coder->encode($data);
        }
    }

    return ($ok, $out, $content);
}

sub content {
    shift->req->content(@_);

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.283 second using v1.00-cache-2.02-grep-82fe00e-cpan-d48b15b8027 )