Psr18Client
in package
implements
ClientInterface, RequestFactoryInterface, StreamFactoryInterface, UriFactoryInterface, ResetInterface
FinalYes
An adapter to turn a Symfony HttpClientInterface into a PSR-18 ClientInterface.
Run "composer require psr/http-client" to install the base ClientInterface. Run "composer require nyholm/psr7" to install an efficient implementation of response and stream factories with flex-provided autowiring aliases.
Tags
Table of Contents
Interfaces
- ClientInterface
- RequestFactoryInterface
- StreamFactoryInterface
- UriFactoryInterface
- ResetInterface
- Provides a way to reset an object to its initial state.
Properties
- $client : mixed
- $responseFactory : mixed
- $streamFactory : mixed
Methods
- __construct() : mixed
- createRequest() : RequestInterface
- {@inheritdoc}
- createStream() : StreamInterface
- {@inheritdoc}
- createStreamFromFile() : StreamInterface
- {@inheritdoc}
- createStreamFromResource() : StreamInterface
- {@inheritdoc}
- createUri() : UriInterface
- {@inheritdoc}
- reset() : mixed
- sendRequest() : ResponseInterface
- {@inheritdoc}
Properties
$client
private
mixed
$client
$responseFactory
private
mixed
$responseFactory
$streamFactory
private
mixed
$streamFactory
Methods
__construct()
public
__construct([HttpClientInterface $client = null ][, ResponseFactoryInterface $responseFactory = null ][, StreamFactoryInterface $streamFactory = null ]) : mixed
Parameters
- $client : HttpClientInterface = null
- $responseFactory : ResponseFactoryInterface = null
- $streamFactory : StreamFactoryInterface = null
createRequest()
{@inheritdoc}
public
createRequest(string $method, mixed $uri) : RequestInterface
Parameters
- $method : string
- $uri : mixed
Return values
RequestInterfacecreateStream()
{@inheritdoc}
public
createStream([string $content = '' ]) : StreamInterface
Parameters
- $content : string = ''
Return values
StreamInterfacecreateStreamFromFile()
{@inheritdoc}
public
createStreamFromFile(string $filename[, string $mode = 'r' ]) : StreamInterface
Parameters
- $filename : string
- $mode : string = 'r'
Return values
StreamInterfacecreateStreamFromResource()
{@inheritdoc}
public
createStreamFromResource(mixed $resource) : StreamInterface
Parameters
- $resource : mixed
Return values
StreamInterfacecreateUri()
{@inheritdoc}
public
createUri([string $uri = '' ]) : UriInterface
Parameters
- $uri : string = ''
Return values
UriInterfacereset()
public
reset() : mixed
sendRequest()
{@inheritdoc}
public
sendRequest(RequestInterface $request) : ResponseInterface
Parameters
- $request : RequestInterface