2017 © Pedro Peláez
 

library rest-client

Library to consume REST APIs

image

innmind/rest-client

Library to consume REST APIs

  • Sunday, February 25, 2018
  • by Baptouuuu
  • Repository
  • 1 Watchers
  • 2 Stars
  • 18,654 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 18 Versions
  • 4 % Grown

The README.md

RestClient

Build Status codecov Type Coverage, (*1)

This library is intended to consume APIs built with the RestServer., (*2)

Installation

composer require innmind/rest-client

Usage

use Innmind\OperatingSystem\Factory;
use Innmind\Url\Path;
use Innmind\UrlResolver\UrlResolver;
use function Innmind\Rest\Client\bootstrap;

$os = Factory::build();
$client = bootstrap(
    $os->remote()->http(),
    new UrlResolver,
    $os->filesystem()->mount(Path::of('/somewhere/to/cache/data')),
);

$client
    ->server('http://example.com/')
    ->capabilities()
    ->names();

This example would return all the resource available through the api of http://example.com/., (*3)

Then you can access the following method on any server: all, read, create, update and remove. Check the interface to understand how to use these methods., (*4)

Structure

, (*5)

The Versions