innmind/rest-client-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Library to consume REST APIs

4.0.0 2017-10-06 05:32 UTC

This package is auto-updated.

Last update: 2022-02-01 13:03:16 UTC


README

master develop
Scrutinizer Code Quality Scrutinizer Code Quality
Code Coverage Code Coverage
Build Status Build Status

Installation

composer require innmind/rest-client-bundle

Enable the bundle by adding the following line in your app/AppKernel.php of your project:

// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Innmind\Rest\ClientBundle\InnmindRestClientBundle,
        );
        // ...
    }
    // ...
}

Then you need to specify the types you allow in the app, here's an example:

innmind_rest_client:
    content_type:
        json:
            priority: 0
            media_types:
                application/json: 0

Usage

$container
    ->get('innmind_rest_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.