AbstractCurl
extends AbstractHandler
in package
AbstractYes
HTTP client abstract curl class
Tags
Table of Contents
Properties
- $httpVersion : string
- HTTP version
- $options : array<string|int, mixed>
- Curl options
- $resource : mixed
- Client resource object
- $response : mixed
- Curl response
- $uri : string|null
- URI string
Methods
- __construct() : mixed
- Constructor
- curl() : mixed
- Return curl resource (alias to $this->getResource())
- disconnect() : void
- Close the handler connection
- getErrorMessage() : string
- Get Curl error number
- getErrorNumber() : int
- Get Curl error number
- getHttpVersion() : string
- Get the URI string
- getOption() : mixed
- Get a Curl option
- getOptions() : array<string|int, mixed>
- Get Curl options
- getResource() : mixed
- Get the resource
- getResponse() : mixed
- Get Curl response
- getUri() : string|null
- Get the URI string
- getUriObject() : Uri
- Get the URI as an object
- hasOption() : bool
- Has a Curl option
- hasOptions() : bool
- Has Curl options
- hasResource() : bool
- Determine whether or not resource is available
- hasResponse() : bool
- Has a Curl response
- hasUri() : bool
- Determine whether or not there is a URI string
- removeOption() : AbstractCurl
- Remove Curl option
- reset() : AbstractHandler
- Method to reset the handler
- resource() : mixed
- Get the resource (alias method)
- send() : mixed
- Method to send the request
- setOption() : AbstractCurl
- Set Curl option
- setOptions() : AbstractCurl
- Set Curl options
- setResponse() : AbstractCurl
- Get Curl response
- version() : array<string|int, mixed>
- Return the Curl version
Properties
$httpVersion
HTTP version
protected
string
$httpVersion
= '1.1'
$options
Curl options
protected
array<string|int, mixed>
$options
= []
$resource
Client resource object
protected
mixed
$resource
= null
$response
Curl response
protected
mixed
$response
= null
$uri
URI string
protected
string|null
$uri
= null
Methods
__construct()
Constructor
public
abstract __construct([array<string|int, mixed>|null $options = null ]) : mixed
Instantiate the Curl handler object
Parameters
- $options : array<string|int, mixed>|null = null
Tags
curl()
Return curl resource (alias to $this->getResource())
public
curl() : mixed
disconnect()
Close the handler connection
public
abstract disconnect() : void
getErrorMessage()
Get Curl error number
public
getErrorMessage() : string
Return values
stringgetErrorNumber()
Get Curl error number
public
getErrorNumber() : int
Return values
intgetHttpVersion()
Get the URI string
public
getHttpVersion() : string
Return values
stringgetOption()
Get a Curl option
public
getOption(int $opt) : mixed
Parameters
- $opt : int
getOptions()
Get Curl options
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getResource()
Get the resource
public
getResource() : mixed
getResponse()
Get Curl response
public
getResponse() : 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
UrihasOption()
Has a Curl option
public
hasOption(int $opt) : bool
Parameters
- $opt : int
Return values
boolhasOptions()
Has Curl options
public
hasOptions() : bool
Return values
boolhasResource()
Determine whether or not resource is available
public
hasResource() : bool
Return values
boolhasResponse()
Has a Curl response
public
hasResponse() : bool
Return values
boolhasUri()
Determine whether or not there is a URI string
public
hasUri() : bool
Return values
boolremoveOption()
Remove Curl option
public
removeOption(int $opt) : AbstractCurl
Parameters
- $opt : int
Return values
AbstractCurlreset()
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
setOption()
Set Curl option
public
setOption(int $opt, mixed $val) : AbstractCurl
Parameters
- $opt : int
- $val : mixed
Return values
AbstractCurlsetOptions()
Set Curl options
public
setOptions(array<string|int, mixed> $options) : AbstractCurl
Parameters
- $options : array<string|int, mixed>
Return values
AbstractCurlsetResponse()
Get Curl response
public
setResponse(mixed $response) : AbstractCurl
Parameters
- $response : mixed
Return values
AbstractCurlversion()
Return the Curl version
public
version() : array<string|int, mixed>