Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Innmind/rest-client

Repository files navigation

RestClient

Build Status codecov Type Coverage

This library is intended to consume APIs built with the RestServer.

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/.

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.

Structure

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages