Download the PHP package uzdevid/conflux-http without Composer
On this page you can find all versions of the php package uzdevid/conflux-http. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download uzdevid/conflux-http
More information about uzdevid/conflux-http
Files in uzdevid/conflux-http
Package conflux-http
Short Description Conflux HTTP — This is a flexible architecture for integration with external HTTP services, built on the basis of the PSR-18 and Guzzle. Each request is made out as a separate class that implements the necessary interfaces, providing readability, testability and expansion.
License MIT
Informations about the package conflux-http
Conflux HTTP
Conflux HTTP — This is a flexible architecture for integration with external HTTP services, built on the basis of the PSR-18 and Guzzle. Each request is made out as a separate class that implements the necessary interfaces, providing readability, testability and expansion.
Requirements
- PHP 8.3 or higher.
Installation
The package could be installed with Composer:
Quick start
1. Configuration
2. Create request class
3. Send request
Implemented request interfaces
RequestInterface
Mandatory interface, sets the method, path and parser answer:
You can use trait
Uzdevid\Conflux\Http\Parser\JsonParser
to pars the answers in JSON format
RequestQueryInterface
If you need to send the query parameters or specify them to the URL:
RequestBodyInterface
If you need send body (POST
, PUT
etc.):
RequestHeadersInterface
Custom headers:
ConvertableBodyInterface
If after parsing the body needs to be converted into an object:
Example with POST request and body:
URL replacement
If the getUrl()
contains the placeholders {}
, they will be automatically replaced by values from getQueryPath()
.
Result: GET /users/5
Handle events
You can subscribe to the events of BeforeRequest
, AfterRequest
and OnThrow
using the EventDispatcherInterface
from the package yiisoft/event-dispatcher
If you have suggestions or features, open it issue or write Pull Request ✨
All versions of conflux-http with dependencies
guzzlehttp/guzzle Version ^7.9
yiisoft/event-dispatcher Version ^1.1
ext-libxml Version *
ext-simplexml Version *