AbstractHandler
in package
implements
HandlerInterface
HTTP client handler interface
Tags
Table of Contents
Interfaces
- HandlerInterface
- HTTP client handler interface
Properties
- $httpVersion : string
- HTTP version
- $request : Request|null
- The request currently being (or last) prepared, carried so a thrown Client\Handler\Exception can implement NetworkExceptionInterface::getRequest()
- $resource : mixed
- Client resource object
- $uri : string|null
- URI string
Methods
- disconnect() : void
- Close the handler connection
- getHttpVersion() : string
- Get the URI string
- getResource() : mixed
- Get the resource
- getUri() : string|null
- Get the URI string
- getUriObject() : Uri
- Get the URI as an object
- hasResource() : bool
- Determine whether or not resource is available
- hasUri() : bool
- Determine whether or not there is a URI string
- reset() : AbstractHandler
- Method to reset the handler
- resource() : mixed
- Get the resource (alias method)
- send() : mixed
- Method to send the request
- collectRequestHeaders() : array<string|int, mixed>
- Collect the flat list of header strings for a request, shared by every handler
- resolveRequestBody() : array<string|int, mixed>
- Resolve what a request's outbound body should be, shared by every handler.
Properties
$httpVersion
HTTP version
protected
string
$httpVersion
= '1.1'
$request
The request currently being (or last) prepared, carried so a thrown Client\Handler\Exception can implement NetworkExceptionInterface::getRequest()
protected
Request|null
$request
= null
$resource
Client resource object
protected
mixed
$resource
= null
$uri
URI string
protected
string|null
$uri
= null
Methods
disconnect()
Close the handler connection
public
abstract disconnect() : void
getHttpVersion()
Get the URI string
public
getHttpVersion() : string
Return values
stringgetResource()
Get the resource
public
getResource() : mixed
getUri()
Get the URI string
public
getUri() : string|null
Return values
string|nullgetUriObject()
Get the URI as an object
public
getUriObject() : Uri
Return values
UrihasResource()
Determine whether or not resource is available
public
hasResource() : bool
Return values
boolhasUri()
Determine whether or not there is a URI string
public
hasUri() : bool
Return values
boolreset()
Method to reset the handler
public
abstract reset() : AbstractHandler
Return values
AbstractHandlerresource()
Get the resource (alias method)
public
resource() : mixed
send()
Method to send the request
public
abstract send() : mixed
collectRequestHeaders()
Collect the flat list of header strings for a request, shared by every handler
protected
collectRequestHeaders(Request $request) : array<string|int, mixed>
Parameters
- $request : Request
Return values
array<string|int, mixed>resolveRequestBody()
Resolve what a request's outbound body should be, shared by every handler.
protected
resolveRequestBody(Request $request) : array<string|int, mixed>
Multipart requests resolve to the curl-native array shape (scalars + CURLFile), which Curl can pass directly to CURLOPT_POSTFIELDS for zero-copy file streaming; handlers without that capability (Stream) fall back to Body\Multipart::build().
Parameters
- $request : Request