Download the PHP package vasildakov/speedy without Composer
On this page you can find all versions of the php package vasildakov/speedy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vasildakov/speedy
More information about vasildakov/speedy
Files in vasildakov/speedy
Package speedy
Short Description Speedy API Client
License MIT
Homepage https://github.com/vasildakov/speedy
Informations about the package speedy
Speedy API Client
An easy to use PHP client for Speedy REST API
Speedy client is a PSR-7 and PSR-18 compliant HTTP client that implements Speedy communication protocol. It has clean and consistent API, is fully unit tested and even comes with an example application to get you started.
Features
This library is compliant with PSR-7: HTTP message interfaces, PSR-17: HTTP Factories and PSR-18: HTTP Client
Installation
Using Composer:
Usage
The Configuration
Let's presume that you are using PHP dotenv to load environment variables
from a file named .env
. In this case, you need to add the following variables:
The next step is to create a new Configuration instance like in the example bellow:
Configuring Speedy Client
The final step is to configure the Speedy client.
The client can be configured with any PSR-18 HTTP Client
and PSR-17 HTTP Factory
:
Example with Guzzle and Laminas Diactoros
Example with Symfony HTTP Client and Nyholm HTTP Factory
Making a Request
Once you have configured the client, you can proceed to make your first request. By default, each method returns the data in JSON, which can then be utilized as a simple PHP array or deserialized into the PHP model.
Processing the Response
The client API always returns the raw JSON response received from the endpoint. The JSON can be used as it is, decoded into a PHP associative array, or deserialized into a model object.
Deserialization can be achieved in two different ways: 1) by using the serializer, or 2) by decorating the original Speedy client with the SpeedyModelDecorator.
Using serializer:
Instead of calling the serializer every time, you can enhance the original Speedy client by decorating it with the SpeedyModelDecorator. This enhancement makes the responses more convenient, predictable and easy to use.
Using the model
Documentation
TBC
License
Code released under the MIT license
Speedy REST API examples
Speedy Web API Integration
All versions of speedy with dependencies
ext-curl Version *
ext-json Version *
ext-xsl Version *
beberlei/assert Version ^3.3
doctrine/cache Version ^1.13
doctrine/collections Version ^2.1
fig/http-message-util Version ^1.1
guzzlehttp/guzzle Version ^7.7
guzzlehttp/psr7 Version ^2.5
jms/serializer Version ^3.25
laminas/laminas-diactoros Version ^3.0
laminas/laminas-hydrator Version ^4.14
laminas/laminas-serializer Version ^2.14
php-http/curl-client Version ^2.3
php-http/discovery Version ^1.14
php-http/message Version ^1.13
vlucas/phpdotenv Version ^5.5