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
$connect_timeout
protected
int
$connect_timeout
= 3
$follow_location
protected
bool
$follow_location
= true
$ssl_verification
protected
bool
$ssl_verification
= true
$timeout
protected
int
$timeout
= 10
$response
private
ResponseInterface
$response
= null
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
Return values
ResponsegetRequestContent()
Retrieve request content.
private
getRequestContent(RequestInterface $request) : string
Parameters
- $request : RequestInterface
Return values
stringgetRequestHeaders()
Retrieve request headers.
private
getRequestHeaders(RequestInterface $request) : array<string|int, string>
Parameters
- $request : RequestInterface