API-Client

 view release on metacpan or  search on metacpan

INSTALL  view on Meta::CPAN

Alternatively, if your CPAN shell is set up, you should just be able to do:

    % cpan API::Client

## Manual installation

As a last resort, you can manually install it. Download the tarball, untar it,
install configure prerequisites (see below), then build it:

    % perl Makefile.PL
    % make && make test

Then install it:

    % make install

On Windows platforms, you should use `dmake` or `nmake`, instead of `make`.

If your perl is system-managed, you can create a local::lib in your home
directory to install modules to. For details, see the local::lib documentation:
https://metacpan.org/pod/local::lib

INSTALL  view on Meta::CPAN

"{prereqs}{configure}{requires}" key of META.json.

## Other Prerequisites

This distribution may require additional modules to be installed after running
Makefile.PL.
Look for prerequisites in the following phases:

* to run make, PHASE = build
* to use the module code itself, PHASE = runtime
* to run tests, PHASE = test

They can all be found in the "PHASE_requires" key of MYMETA.yml or the
"{prereqs}{PHASE}{requires}" key of MYMETA.json.

## Documentation

API-Client documentation is available as POD.
You can run `perldoc` from a shell to read the documentation:

    % perldoc API::Client

LICENSE  view on Meta::CPAN

OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

                     END OF TERMS AND CONDITIONS

        Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

  To do so, attach the following notices to the program.  It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>

META.json  view on Meta::CPAN

            "Data::Object::Role::Stashable" : "2.01",
            "Data::Object::Role::Throwable" : "2.01",
            "FlightRecorder" : "0.03",
            "Mojolicious" : "8.35",
            "perl" : "5.014",
            "routines" : "0",
            "strict" : "0",
            "warnings" : "0"
         }
      },
      "test" : {
         "requires" : {
            "Data::Object::Class" : "2.02",
            "Data::Object::ClassHas" : "2.01",
            "Data::Object::Role::Buildable" : "0.03",
            "Data::Object::Role::Stashable" : "2.01",
            "Data::Object::Role::Throwable" : "2.01",
            "FlightRecorder" : "0.03",
            "Mojolicious" : "8.35",
            "Test::Auto" : "0.10",
            "perl" : "5.014",

Makefile.PL  view on Meta::CPAN

    "Data::Object::Role::Stashable" => "2.01",
    "Data::Object::Role::Throwable" => "2.01",
    "FlightRecorder" => "0.03",
    "Mojolicious" => "8.35",
    "Test::Auto" => "0.10",
    "routines" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "VERSION" => "0.12",
  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Data::Object::Class" => "2.02",
  "Data::Object::ClassHas" => "2.01",
  "Data::Object::Role::Buildable" => "0.03",
  "Data::Object::Role::Stashable" => "2.01",

cpanfile  view on Meta::CPAN

requires "Data::Object::Role::Buildable" => "0.03";
requires "Data::Object::Role::Stashable" => "2.01";
requires "Data::Object::Role::Throwable" => "2.01";
requires "FlightRecorder" => "0.03";
requires "Mojolicious" => "8.35";
requires "perl" => "5.014";
requires "routines" => "0";
requires "strict" => "0";
requires "warnings" => "0";

on 'test' => sub {
  requires "Data::Object::Class" => "2.02";
  requires "Data::Object::ClassHas" => "2.01";
  requires "Data::Object::Role::Buildable" => "0.03";
  requires "Data::Object::Role::Stashable" => "2.01";
  requires "Data::Object::Role::Throwable" => "2.01";
  requires "FlightRecorder" => "0.03";
  requires "Mojolicious" => "8.35";
  requires "Test::Auto" => "0.10";
  requires "perl" => "5.014";
  requires "routines" => "0";

t/API_Client.t  view on Meta::CPAN

    json => {active => 1}
  );

=cut

package main;

use Mojo::UserAgent;

SKIP: {
  my $skip_tests = do {
    my $tx = Mojo::UserAgent->new->get('https://httpbin.org/anything');

    !eval{$tx->result->is_success};
  };

  unless ($skip_tests) {
    my $test = testauto(__FILE__);

    my $subs = $test->standard;

    $subs->synopsis(fun($tryable) {
      ok my $result = $tryable->result;

      $result
    });

    $subs->scenario('building', fun($tryable) {
      require Scalar::Util;
      ok my $result = $tryable->result;

t/API_Client.t  view on Meta::CPAN


      my $json = $res->json;
      is $json->{headers}{'Host'}, 'httpbin.org';
      is $json->{headers}{'Content-Type'}, 'application/json';
      is_deeply $json->{json}, {active => 1};

      $result
    });
  }

  skip 'Unable to connect to HTTPBin' if $skip_tests;
}

ok 1 and done_testing;



( run in 0.276 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )