Download the PHP package sidus/api-client-bundle without Composer
On this page you can find all versions of the php package sidus/api-client-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sidus/api-client-bundle
More information about sidus/api-client-bundle
Files in sidus/api-client-bundle
Package api-client-bundle
Short Description Ease the creation of business API client with authentication, serialization and cache
License MIT
Homepage https://github.com/VincentChalnot/api-client-bundle
Informations about the package api-client-bundle
Sidus/ApiClientBundle
Introduction
This library provides basic blocks for building a business oriented OAuth API client very easily.
Features
- Automatic token negotiation
- Serialization and deserialization of API requests and responses
- Cache layer for API responses
- Easy to extend and customize
Basic usage
Simple request:
Using normalizations/denormalization:
Using cache:
Installation
Configuration
You have two options to provide credentials for token negotiation:
Declare a Credentials service:
Each time you create an API request using the same base URL, the credentials will be automatically used.
Or you can provide the access token directly in the API request:
Or any custom authorization component implementing the
\Sidus\ApiClientBundle\Contracts\Request\Component\AuthorizationComponentInterface
.
When using custom headers, simply add the custom header in the API request:
Or use an event listener to add the header automatically using the \Sidus\ApiClientBundle\Model\Event\ApiRequestEvent
event.
All versions of api-client-bundle with dependencies
symfony/serializer Version >5.3
symfony/cache-contracts Version >2.0
psr/http-client Version >1.0
psr/http-factory Version >1.0