class Response (View source)

Properties

string|null $content

Define the request content

Methods

__construct(CurlHandle $ch, string|null $content = null)

Parser constructor.

array
toArray()

Get response content as json

object|array
toJson(bool|null $associative = null)

Get response content as json

string|null
getContent()

Get response content

array
getHeaders()

Get the response headers

int|null
statusCode()

Alias of getCode

int|null
getCode()

Get the response code

bool
isFailed()

Check if status code is failed

bool
isSuccessful()

Check if status code is successful

mixed
getExecutionTime()

Get the response executing time

float|null
getConnexionTime()

Get the request connexion time

float|null
getUploadSize()

Get the response upload size

float|null
getUploadSpeed()

Get the request upload speed

float|null
getDownloadSize()

Get the download size

float|null
getDownloadSpeed()

Get the download speed

string
getErrorMessage()

Get error message

int
getErrorNumber()

Get error code

string|null
getContentType()

Get the response content type

Details

__construct(CurlHandle $ch, string|null $content = null)

Parser constructor.

Parameters

CurlHandle $ch
string|null $content

array toArray()

Get response content as json

Return Value

array

object|array toJson(bool|null $associative = null)

Get response content as json

Parameters

bool|null $associative

Return Value

object|array

string|null getContent()

Get response content

Return Value

string|null

array getHeaders()

Get the response headers

Return Value

array

int|null statusCode()

Alias of getCode

Return Value

int|null

int|null getCode()

Get the response code

Return Value

int|null

bool isFailed()

Check if status code is failed

Return Value

bool

bool isSuccessful()

Check if status code is successful

Return Value

bool

mixed getExecutionTime()

Get the response executing time

Return Value

mixed

float|null getConnexionTime()

Get the request connexion time

Return Value

float|null

float|null getUploadSize()

Get the response upload size

Return Value

float|null

float|null getUploadSpeed()

Get the request upload speed

Return Value

float|null

float|null getDownloadSize()

Get the download size

Return Value

float|null

float|null getDownloadSpeed()

Get the download speed

Return Value

float|null

string getErrorMessage()

Get error message

Return Value

string

int getErrorNumber()

Get error code

Return Value

int

string|null getContentType()

Get the response content type

Return Value

string|null