Documentation

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

Methods

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
string

getResponseCode()

Returns curl response code

public getResponseCode() : int
Return values
int

getResponseError()

Returns the error string if curl error

public getResponseError() : string
Return values
string

getResponseHeader()

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
bool

checkForZip()

Checks for the signature values of gzip and bzip2

private checkForZip(mixed $content) : bool
Parameters
$content : mixed
Return values
bool

        
On this page

Search results