CurlClient
class CurlClient (View source)
Properties
protected | $curl | ||
protected | $restart | ||
protected | $cookies | ||
protected | $authentication |
Methods
Creates a new HTTP client based on cURL.
Closes the underlying cURL handle.
Sets a timeout for the current cURL handler's requests.
Returns a string with the list of cookies for the Cookie header.
Executes a Curl.
Executes a DELETE on a resource.
GETs a resource.
Executes a POST on a location.
PUTs a resource.
Sets the authentication string for the next HTTP requests.
Sets an HTTP header to send within the request.
Reinitializes the client for a completely new session.
Returns an array with a set of default options for cURL.
Creates and initializes the underlying cURL handle.
Details
at line 36
__construct(boolean $restart = false, integer $timeout = 10)
Creates a new HTTP client based on cURL.
at line 48
__destruct()
Closes the underlying cURL handle.
at line 60
setTimeout(integer $timeout)
Sets a timeout for the current cURL handler's requests.
at line 70
protected string
getRequestCookies()
Returns a string with the list of cookies for the Cookie header.
at line 89
CurlClientResponse
execute(String $method, String $location)
Executes a Curl.
at line 118
CurlClientResponse
delete($location, $body = null)
Executes a DELETE on a resource.
at line 135
CurlClientResponse
get(String $location)
GETs a resource.
at line 149
CurlClientResponse
post(String $location, String $body)
Executes a POST on a location.
at line 165
CurlClientResponse
put(String $location, String $body)
PUTs a resource.
at line 179
setAuthentication(String $credentials)
Sets the authentication string for the next HTTP requests.
at line 191
setHeader(type $header, type $value)
Sets an HTTP header to send within the request.
at line 199
restart()
Reinitializes the client for a completely new session.
at line 212
protected array
getDefaultCurlOptions()
Returns an array with a set of default options for cURL.
at line 225
protected resource
createCurlHandle()
Creates and initializes the underlying cURL handle.