AbstractClient
Table of Contents
- $body : string
- Response body.
- $code : int
- Response code.
- $context : resource
- Stream context.
- $contextOptions : array<string|int, mixed>
- Stream context options.
- $contextParams : array<string|int, mixed>
- Stream context parameters.
- $fields : array<string|int, mixed>
- Fields.
- $httpResponseHeaders : string
- HTTP Response Headers.
- $message : string
- Response message.
- $method : string
- Method.
- $mode : string
- Stream mode.
- $options : array<string|int, mixed>
- CURL options.
- $query : string
- Query.
- $requestHeaders : array<string|int, mixed>
- Request headers.
- $resource : object
- Client resource object.
- $response : string
- Raw response string.
- $responseHeader : string
- Raw response header.
- $responseHeaders : array<string|int, mixed>
- Response headers.
- $url : string
- URL.
- $version : string
- HTTP version from response.
- close() : void
- Close the client resource.
- decodeBody() : void
- Decode the body.
- getBody() : string
- Get the response body.
- getCode() : string
- Get the response code.
- getField() : string
- Get a field.
- getHttpVersion() : string
- Get the response HTTP version.
- getMessage() : string
- Get the response HTTP message.
- getMethod() : string
- Get the method.
- getQuery() : string
- Get the HTTP query.
- getQueryLength() : int
- Get HTTP query length.
- getRawResponseHeader() : string
- Get raw response header.
- getRequestHeader() : mixed
- Get a request header.
- getRequestHeaders() : array<string|int, mixed>
- Get all request headers.
- getResource() : resource
- Get the resource.
- getResponse() : string
- Get the raw response.
- getResponseHeader() : mixed
- Get a response header.
- getResponseHeaders() : array<string|int, mixed>
- Get all response headers.
- getUrl() : string
- Get the URL.
- hasRequestHeaders() : bool
- Determine if there are request headers.
- hasResource() : bool
- Determine whether or not resource is available.
- hasResponseHeaders() : bool
- Determine if there are response headers.
- open() : AbstractClient
- Create and open the client resource.
- prepareQuery() : object
- Prepare the HTTP query.
- removeField() : object
- Remove a field.
- send() : void
- Method to send the request and get the response.
- setField() : object
- Set the fields.
- setFields() : object
- Set fields.
- setMethod() : object
- Set the method.
- setRequestHeader() : object
- Set a request header.
- setRequestHeaders() : object
- Set all request headers.
- setUrl() : object
- Set the URL.
Properties
$body
Response body.
protected
string
$body
= ''
Tags
$code
Response code.
protected
int
$code
Tags
$context
Stream context.
protected
resource
$context
= null
Tags
$contextOptions
Stream context options.
protected
array<string|int, mixed>
$contextOptions
= []
Tags
$contextParams
Stream context parameters.
protected
array<string|int, mixed>
$contextParams
= []
Tags
$fields
Fields.
protected
array<string|int, mixed>
$fields
= []
Tags
$httpResponseHeaders
HTTP Response Headers.
protected
string
$httpResponseHeaders
= null
Tags
$message
Response message.
protected
string
$message
= ''
Tags
$method
Method.
protected
string
$method
= ''
Tags
$mode
Stream mode.
protected
string
$mode
= 'r'
Tags
$options
CURL options.
protected
array<string|int, mixed>
$options
= []
Tags
$query
Query.
protected
string
$query
= ''
Tags
$requestHeaders
Request headers.
protected
array<string|int, mixed>
$requestHeaders
= []
Tags
$resource
Client resource object.
protected
object
$resource
= ''
Tags
$response
Raw response string.
protected
string
$response
= ''
Tags
$responseHeader
Raw response header.
protected
string
$responseHeader
= ''
Tags
$responseHeaders
Response headers.
protected
array<string|int, mixed>
$responseHeaders
= []
Tags
$url
URL.
protected
string
$url
= ''
Tags
$version
HTTP version from response.
protected
string
$version
= ''
Tags
Methods
close()
Close the client resource.
public
abstract close() : void
Tags
Return values
void —decodeBody()
Decode the body.
public
decodeBody() : void
Tags
Return values
void —getBody()
Get the response body.
public
getBody() : string
Tags
Return values
string —getCode()
Get the response code.
public
getCode() : string
Tags
Return values
string —getField()
Get a field.
public
getField((string) $name) : string
Parameters
- $name : (string)
-
name of field
Tags
Return values
string —getHttpVersion()
Get the response HTTP version.
public
getHttpVersion() : string
Tags
Return values
string —getMessage()
Get the response HTTP message.
public
getMessage() : string
Tags
Return values
string —getMethod()
Get the method.
public
getMethod() : string
Tags
Return values
string —getQuery()
Get the HTTP query.
public
getQuery() : string
Tags
Return values
string —getQueryLength()
Get HTTP query length.
public
getQueryLength([(bool) $mb = true ]) : int
Parameters
- $mb : (bool) = true
Tags
Return values
int —getRawResponseHeader()
Get raw response header.
public
getRawResponseHeader() : string
Tags
Return values
string —getRequestHeader()
Get a request header.
public
getRequestHeader((string) $name) : mixed
Parameters
- $name : (string)
Tags
Return values
mixed —getRequestHeaders()
Get all request headers.
public
getRequestHeaders() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getResource()
Get the resource.
public
getResource() : resource
Tags
Return values
resource —getResponse()
Get the raw response.
public
getResponse() : string
Tags
Return values
string —getResponseHeader()
Get a response header.
public
getResponseHeader((string) $name) : mixed
Parameters
- $name : (string)
Tags
Return values
mixed —getResponseHeaders()
Get all response headers.
public
getResponseHeaders() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getUrl()
Get the URL.
public
getUrl() : string
Tags
Return values
string —hasRequestHeaders()
Determine if there are request headers.
public
hasRequestHeaders() : bool
Tags
Return values
bool —hasResource()
Determine whether or not resource is available.
public
hasResource() : bool
Tags
Return values
bool —hasResponseHeaders()
Determine if there are response headers.
public
hasResponseHeaders() : bool
Tags
Return values
bool —open()
Create and open the client resource.
public
abstract open() : AbstractClient
Tags
Return values
AbstractClient —prepareQuery()
Prepare the HTTP query.
public
prepareQuery() : object
Tags
Return values
object —removeField()
Remove a field.
public
removeField((string) $name) : object
Parameters
- $name : (string)
-
name of field
Tags
Return values
object —send()
Method to send the request and get the response.
public
abstract send() : void
Tags
Return values
void —setField()
Set the fields.
public
setField((string) $name, mixed $value) : object
Parameters
- $name : (string)
-
(string) $value
- $value : mixed
Tags
Return values
object —setFields()
Set fields.
public
setFields((array) $fields) : object
Parameters
- $fields : (array)
Tags
Return values
object —setMethod()
Set the method.
public
setMethod((string) $method) : object
Parameters
- $method : (string)
Tags
Return values
object —setRequestHeader()
Set a request header.
public
setRequestHeader((string) $name, (string) $value) : object
Parameters
- $name : (string)
- $value : (string)
Tags
Return values
object —setRequestHeaders()
Set all request headers.
public
setRequestHeaders((\alphaz\http\Clients\arryay) $headers) : object
Parameters
- $headers : (\alphaz\http\Clients\arryay)
Tags
Return values
object —setUrl()
Set the URL.
public
setUrl((string) $url) : object
Parameters
- $url : (string)