RosetteRequest
in package
Class RosetteRequest.
Wraps the php curl commands into an easier to use (and mock) object
Table of Contents
Properties
- $initialized : bool
- indicates that curl is initialized
- $response : mixed
- Response object
Methods
- __construct() : mixed
- class constructor
- __destruct() : mixed
- class destructor
- getResponse() : mixed
- Returns the associative array response or the error message
- getResponseBody() : string
- Returns the body element of the response object
- getResponseCode() : int
- Returns curl response code
- getResponseError() : string
- Returns the error string if curl error
- getResponseHeader() : array<string|int, mixed>
- Returns the header from the curl response
- makeRequest() : bool
- Wraps the curl call
- checkForZip() : bool
- Checks for the signature values of gzip and bzip2
Properties
$initialized
indicates that curl is initialized
private
bool
$initialized
$response
Response object
private
mixed
$response
Methods
__construct()
class constructor
public
__construct() : mixed
__destruct()
class destructor
public
__destruct() : mixed
getResponse()
Returns the associative array response or the error message
public
getResponse() : mixed
getResponseBody()
Returns the body element of the response object
public
getResponseBody() : string
Return values
stringgetResponseCode()
Returns curl response code
public
getResponseCode() : int
Return values
intgetResponseError()
Returns the error string if curl error
public
getResponseError() : string
Return values
stringgetResponseHeader()
Returns the header from the curl response
public
getResponseHeader() : array<string|int, mixed>
Return values
array<string|int, mixed>makeRequest()
Wraps the curl call
public
makeRequest(string $url, string $headers, string $data, string $method, mixed $timeout[, mixed $url_params = null ]) : bool
Parameters
- $url : string
-
URL of the Api API
- $headers : string
-
Response headers
- $data : string
-
Response data
- $method : string
-
GET or POST
- $timeout : mixed
- $url_params : mixed = null
Return values
boolcheckForZip()
Checks for the signature values of gzip and bzip2
private
checkForZip(mixed $content) : bool
Parameters
- $content : mixed