PHP PSR

AbstractClient
in package
implements ClientInterface

AbstractYes

This is a simple PSR-18 Client implementation that other PSR-18 Client can inherit from.

Table of Contents

Interfaces

ClientInterface

Properties

$connect_timeout  : int
$follow_location  : bool
$ssl_verification  : bool
$timeout  : int
$response  : ResponseInterface

Methods

__construct()  : mixed
sendRequest()  : Response
Sends a PSR-7 request and returns a PSR-7 response.
getRequestContent()  : string
Retrieve request content.
getRequestHeaders()  : array<string|int, string>
Retrieve request headers.

Properties

Methods

__construct()

public __construct([array<string, mixed> $Config = [] ]) : mixed
Parameters
$Config : array<string, mixed> = []

The configuration.

sendRequest()

Sends a PSR-7 request and returns a PSR-7 response.

public sendRequest(RequestInterface $request) : Response
Parameters
$request : RequestInterface
Tags
throws
ClientExceptionInterface

If an error happens while processing the request.

Return values
Response

getRequestContent()

Retrieve request content.

private getRequestContent(RequestInterface $request) : string
Parameters
$request : RequestInterface
Return values
string

getRequestHeaders()

Retrieve request headers.

private getRequestHeaders(RequestInterface $request) : array<string|int, string>
Parameters
$request : RequestInterface
Return values
array<string|int, string>

        
On this page

Search results