2017 © Pedro Peláez
 

library json-api-client

Abstract client-side php implementation of the json api specification (jsonapi.org)

image

enm/json-api-client

Abstract client-side php implementation of the json api specification (jsonapi.org)

  • Tuesday, March 6, 2018
  • by eosnewmedia
  • Repository
  • 5 Watchers
  • 5 Stars
  • 3,705 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 7 Versions
  • 55 % Grown

The README.md

JSON API Client

Build Status, (*1)

Abstract client-side PHP implementation of the json api specification., (*2)

Installation

composer require enm/json-api-client

You can use the default HTTP implementation (Enm\JsonApi\HttpClient\GuzzleAdapter) which requires the Guzzle client., (*3)

composer require guzzlehttp/guzzle ^6.0

or the BuzzCurlAdapter (Enm\JsonApi\HttpClient\BuzzCurlAdapter) which requires the kriswallsmith/buzz client., (*4)

composer require kriswallsmith/buzz ^0.16

If needed you can also implement the interface by yourself to use any HTTP client which supports PSR-7., (*5)

Usage

First you should read the docs at enm/json-api-common where all basic structures are defined., (*6)

Your API client is an instance of Enm\JsonApi\Client\JsonApiClient, which requires a HTTP client (Enm\JsonApi\HttpClient\HttpClientInterface) to execute requests., (*7)


$client = new JsonApiClient( 'http://example.com/api', new GuzzleAdapter(new Client()), // with guzzle in this example... new Serializer(), new Deserializer() ); $request = $client->createGetRequest(new Uri('/myResources/1')); // will fetch the resource at http://example.com/api/myResources/1 $request->requestInclude('myRelationship'); // include a relationship $response = $client->execute($request); $document = $response->document(); $myResource = $document->data()->first(); // the resource fetched by this request $myIncludedResources = $document->included()->all(); // the included resources fetched with the include parameter

The Versions

06/03 2018

dev-master

9999999-dev

Abstract client-side php implementation of the json api specification (jsonapi.org)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

06/03 2018

1.2.0

1.2.0.0

Abstract client-side php implementation of the json api specification (jsonapi.org)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

06/03 2018

dev-develop

dev-develop

Abstract client-side php implementation of the json api specification (jsonapi.org)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

20/02 2018

1.1.0

1.1.0.0

Abstract client-side php implementation of the json api specification (jsonapi.org)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

27/12 2017

1.0.2

1.0.2.0

Abstract client-side php implementation of the json api specification (jsonapi.org)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

21/11 2017

1.0.1

1.0.1.0

Abstract client-side php implementation of the json api specification (jsonapi.org)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

20/07 2017

1.0.0

1.0.0.0

Abstract client-side php implementation of the json api specification (jsonapi.org)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien