Documentation

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
author

Nicolas Grekas p@tchwork.com

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

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
RequestInterface

createStream()

{@inheritdoc}

public createStream([string $content = '' ]) : StreamInterface
Parameters
$content : string = ''
Return values
StreamInterface

createStreamFromFile()

{@inheritdoc}

public createStreamFromFile(string $filename[, string $mode = 'r' ]) : StreamInterface
Parameters
$filename : string
$mode : string = 'r'
Return values
StreamInterface

createStreamFromResource()

{@inheritdoc}

public createStreamFromResource(mixed $resource) : StreamInterface
Parameters
$resource : mixed
Return values
StreamInterface

createUri()

{@inheritdoc}

public createUri([string $uri = '' ]) : UriInterface
Parameters
$uri : string = ''
Return values
UriInterface

sendRequest()

{@inheritdoc}

public sendRequest(RequestInterface $request) : ResponseInterface
Parameters
$request : RequestInterface
Return values
ResponseInterface

        
On this page

Search results