Download the PHP package los/los-api-client without Composer
On this page you can find all versions of the php package los/los-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package los-api-client
Api Client for Restful API
LosApiClient is a library to consume Restful APIs using Hal (json or xml) like Apigility.
Can be used with pure PHP or any PHP framework, like ZendFramework 2 and Zend-Expressive.
Requirements
- PHP >= 5.6
- Zend Http >= 2.4
- Zend ModuleManager >= 2.5
- Zend ServiceManager >= 2.5
- nocarrier/hal >= 0.9
Installation
Using composer (recommended)
Configuration
You need to configure at least the Api URI.
If using a framework that implements container-interopt
, you can use the following configuration:
Copy the los-api-client.global.php.dist from this module to your application's config folder and make the necessary changes.
For more information about the http-client options, please check the official documentation at Zend\Http\Client options.
Usage
Creating the client
You can use the LosApiClient\Api\ClientFactory
usign the above configuration or manually:
Injecting a Cerberus Circuit Breaker
You can use the client with a circuit breaker to control failures and success and avoid uncessary attempts.
More information about cerberus on it's own repository.
Single resource
Collection
Paginator
This module provides a paginator helper.
You can easily loop through the pages:
All versions of los-api-client with dependencies
ext-json Version *
ext-mbstring Version *
nocarrier/hal Version ~0.9
zendframework/zend-modulemanager Version ~2.5
zendframework/zend-http Version ~2.4
zendframework/zend-servicemanager Version ~2.5