Psr18Transport
in package
implements
TransportInterface
FinalYes
Мост к любому PSR-18 HTTP-клиенту.
Позволяет использовать существующий клиент экосистемы — например, cloud-castle/http-client, Guzzle или Symfony HttpClient — вместо встроенных транспортов, наследуя его пулы соединений и middleware.
Table of Contents
Interfaces
- TransportInterface
- HTTP-транспорт клиента.
Methods
- __construct() : mixed
- send() : TransportResponse
- Выполняет HTTP-запрос и возвращает ответ сервера.
Methods
__construct()
public
__construct(ClientInterface $client, RequestFactoryInterface $requestFactory, StreamFactoryInterface $streamFactory) : mixed
Parameters
- $client : ClientInterface
-
PSR-18 клиент
- $requestFactory : RequestFactoryInterface
-
фабрика PSR-7 запросов
- $streamFactory : StreamFactoryInterface
-
фабрика PSR-7 потоков
send()
Выполняет HTTP-запрос и возвращает ответ сервера.
public
send(TransportRequest $request) : TransportResponse
Parameters
- $request : TransportRequest
-
описание запроса
Tags
Attributes
- #[Override]
Return values
TransportResponse —ответ сервера с любым статусом