Documentation

CURL extends 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.
__construct()  : mixed
__construct.
close()  : void
Close the cURL connection.
curl()  : resource
Return cURL resource (alias to $this->getResource()).
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.
getInfo()  : mixes
Get curl last session info.
getMessage()  : string
Get the response HTTP message.
getMethod()  : string
Get the method.
getOption()  : mixes
Get curl session option.
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.
isReturnHeader()  : bool
Set curl return header.
isReturnTransfer()  : bool
Set curl return tranfer header.
open()  : object
Create and open cURL 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.
setOption()  : object
Set curl session option.
setOptios()  : object
Set curl session options.
setRequestHeader()  : object
Set a request header.
setRequestHeaders()  : object
Set all request headers.
setReturnHeader()  : object
Set curl return header.
setReturnTransfer()  : object
Set curl return tranfer header.
setUrl()  : object
Set the URL.
version()  : array<string|int, mixed>
Return the cURL version.
parseResponseHeaders()  : void
Parse headers.

Properties

$body

Response body.

protected string $body = ''
Tags
since
1.0.0

$context

Stream context.

protected resource $context = null
Tags
since
1.0.0

$contextOptions

Stream context options.

protected array<string|int, mixed> $contextOptions = []
Tags
since
1.0.0

$contextParams

Stream context parameters.

protected array<string|int, mixed> $contextParams = []
Tags
since
1.0.0

$fields

Fields.

protected array<string|int, mixed> $fields = []
Tags
since
1.0.0

$httpResponseHeaders

HTTP Response Headers.

protected string $httpResponseHeaders = null
Tags
since
1.0.0

$message

Response message.

protected string $message = ''
Tags
since
1.0.0

$mode

Stream mode.

protected string $mode = 'r'
Tags
since
1.0.0

$options

CURL options.

protected array<string|int, mixed> $options = []
Tags
since
1.0.0

$requestHeaders

Request headers.

protected array<string|int, mixed> $requestHeaders = []
Tags
since
1.0.0

$resource

Client resource object.

protected object $resource = ''
Tags
since
1.0.0

$response

Raw response string.

protected string $response = ''
Tags
since
1.0.0

$responseHeader

Raw response header.

protected string $responseHeader = ''
Tags
since
1.0.0

$responseHeaders

Response headers.

protected array<string|int, mixed> $responseHeaders = []
Tags
since
1.0.0

$version

HTTP version from response.

protected string $version = ''
Tags
since
1.0.0

Methods

__construct()

__construct.

public __construct((string) $url[, mixed $method = 'GET' ][, array<string|int, mixed> $options = null ]) : mixed
Parameters
$url : (string)

(string) $method (array) $options

$method : mixed = 'GET'
$options : array<string|int, mixed> = null
Tags
since
1.0.0
Return values
mixed

close()

Close the cURL connection.

public close() : void
Tags
since
1.0.0
Return values
void

curl()

Return cURL resource (alias to $this->getResource()).

public curl() : resource
Tags
since
1.0.0
Return values
resource

decodeBody()

Decode the body.

public decodeBody() : void
Tags
since
1.0.0
Return values
void

getBody()

Get the response body.

public getBody() : string
Tags
since
1.0.0
Return values
string

getCode()

Get the response code.

public getCode() : string
Tags
since
1.0.0
Return values
string

getField()

Get a field.

public getField((string) $name) : string
Parameters
$name : (string)

name of field

Tags
since
1.0.0
Return values
string

getHttpVersion()

Get the response HTTP version.

public getHttpVersion() : string
Tags
since
1.0.0
Return values
string

getInfo()

Get curl last session info.

public getInfo([(\alphaz\http\Clients\mixes) $option = null ]) : mixes
Parameters
$option : (\alphaz\http\Clients\mixes) = null
Tags
since
1.0.0
Return values
mixes

getMessage()

Get the response HTTP message.

public getMessage() : string
Tags
since
1.0.0
Return values
string

getMethod()

Get the method.

public getMethod() : string
Tags
since
1.0.0
Return values
string

getOption()

Get curl session option.

public getOption((\alphaz\http\Clients\mixes) $option) : mixes
Parameters
$option : (\alphaz\http\Clients\mixes)
Tags
since
1.0.0
Return values
mixes

getQuery()

Get the HTTP query.

public getQuery() : string
Tags
since
1.0.0
Return values
string

getQueryLength()

Get HTTP query length.

public getQueryLength([(bool) $mb = true ]) : int
Parameters
$mb : (bool) = true
Tags
since
1.0.0
Return values
int

getRawResponseHeader()

Get raw response header.

public getRawResponseHeader() : string
Tags
since
1.0.0
Return values
string

getRequestHeader()

Get a request header.

public getRequestHeader((string) $name) : mixed
Parameters
$name : (string)
Tags
since
1.0.0
Return values
mixed

getRequestHeaders()

Get all request headers.

public getRequestHeaders() : array<string|int, mixed>
Tags
since
1.0.0
Return values
array<string|int, mixed>

getResource()

Get the resource.

public getResource() : resource
Tags
since
1.0.0
Return values
resource

getResponse()

Get the raw response.

public getResponse() : string
Tags
since
1.0.0
Return values
string

getResponseHeader()

Get a response header.

public getResponseHeader((string) $name) : mixed
Parameters
$name : (string)
Tags
since
1.0.0
Return values
mixed

getResponseHeaders()

Get all response headers.

public getResponseHeaders() : array<string|int, mixed>
Tags
since
1.0.0
Return values
array<string|int, mixed>

getUrl()

Get the URL.

public getUrl() : string
Tags
since
1.0.0
Return values
string

hasRequestHeaders()

Determine if there are request headers.

public hasRequestHeaders() : bool
Tags
since
1.0.0
Return values
bool

hasResource()

Determine whether or not resource is available.

public hasResource() : bool
Tags
since
1.0.0
Return values
bool

hasResponseHeaders()

Determine if there are response headers.

public hasResponseHeaders() : bool
Tags
since
1.0.0
Return values
bool

isReturnHeader()

Set curl return header.

public isReturnHeader() : bool
Tags
since
1.0.0
Return values
bool

isReturnTransfer()

Set curl return tranfer header.

public isReturnTransfer() : bool
Tags
since
1.0.0
Return values
bool

open()

Create and open cURL resource.

public open() : object
Tags
since
1.0.0
Return values
object

prepareQuery()

Prepare the HTTP query.

public prepareQuery() : object
Tags
since
1.0.0
Return values
object

removeField()

Remove a field.

public removeField((string) $name) : object
Parameters
$name : (string)

name of field

Tags
since
1.0.0
Return values
object

send()

Method to send the request and get the response.

public send() : void
Tags
since
1.0.0
Return values
void

setField()

Set the fields.

public setField((string) $name, mixed $value) : object
Parameters
$name : (string)

(string) $value

$value : mixed
Tags
since
1.0.0
Return values
object

setFields()

Set fields.

public setFields((array) $fields) : object
Parameters
$fields : (array)
Tags
since
1.0.0
Return values
object

setMethod()

Set the method.

public setMethod((string) $method) : object
Parameters
$method : (string)
Tags
since
1.0.0
Return values
object

setOption()

Set curl session option.

public setOption((mixed) $option, mixed $value) : object
Parameters
$option : (mixed)

(mixed) $value

$value : mixed
Tags
since
1.0.0
Return values
object

setOptios()

Set curl session options.

public setOptios((array) $options) : object
Parameters
$options : (array)
Tags
since
1.0.0
Return values
object

setRequestHeader()

Set a request header.

public setRequestHeader((string) $name, (string) $value) : object
Parameters
$name : (string)
$value : (string)
Tags
since
1.0.0
Return values
object

setRequestHeaders()

Set all request headers.

public setRequestHeaders((\alphaz\http\Clients\arryay) $headers) : object
Parameters
$headers : (\alphaz\http\Clients\arryay)
Tags
since
1.0.0
Return values
object

setReturnHeader()

Set curl return header.

public setReturnHeader([(bool) $header = true ]) : object
Parameters
$header : (bool) = true
Tags
since
1.0.0
Return values
object

setReturnTransfer()

Set curl return tranfer header.

public setReturnTransfer([(bool) $header = true ]) : object
Parameters
$header : (bool) = true
Tags
since
1.0.0
Return values
object

setUrl()

Set the URL.

public setUrl((string) $url) : object
Parameters
$url : (string)
Tags
since
1.0.0
Return values
object

version()

Return the cURL version.

public version() : array<string|int, mixed>
Tags
since
1.0.0
Return values
array<string|int, mixed>

parseResponseHeaders()

Parse headers.

protected parseResponseHeaders() : void
Tags
since
1.0.0
Return values
void

Search results