Client
extends AbstractClient
in package
Simple Client Implementation.
Table of Contents
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.
- withConnectTimeout() : static
- Return an instance with the provided connect timeout.
- withFollowLocation() : static
- Return an instance with the provided follow location.
- withSslVerification() : static
- Return an instance with the provided ssl verification.
- withTimeout() : static
- Return an instance with the provided timeout.
- 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
ResponsewithConnectTimeout()
Return an instance with the provided connect timeout.
public
withConnectTimeout(int $ConnectTimeout) : static
Parameters
- $ConnectTimeout : int
Return values
staticwithFollowLocation()
Return an instance with the provided follow location.
public
withFollowLocation(bool $FollowLocation) : static
Parameters
- $FollowLocation : bool
Return values
staticwithSslVerification()
Return an instance with the provided ssl verification.
public
withSslVerification(bool $SslVerification) : static
Parameters
- $SslVerification : bool
Return values
staticwithTimeout()
Return an instance with the provided timeout.
public
withTimeout(int $Timeout) : static
Parameters
- $Timeout : int
Return values
staticgetRequestContent()
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