Documentation

AbstractHandler
in package
implements HandlerInterface

AbstractYes

HTTP client handler interface

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
6.0.0

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

$request

The request currently being (or last) prepared, carried so a thrown Client\Handler\Exception can implement NetworkExceptionInterface::getRequest()

protected Request|null $request = null

Methods

disconnect()

Close the handler connection

public abstract disconnect() : void

getHttpVersion()

Get the URI string

public getHttpVersion() : string
Return values
string

getUri()

Get the URI string

public getUri() : string|null
Return values
string|null

hasResource()

Determine whether or not resource is available

public hasResource() : bool
Return values
bool

hasUri()

Determine whether or not there is a URI string

public hasUri() : bool
Return values
bool

resource()

Get the resource (alias method)

public resource() : 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
Return values
array<string|int, mixed>

        
On this page

Search results