PHP Sigfox Client

CallbackHTTP extends Model

Callback of type HTTP

Table of Contents

$body  : string|null
The body of the request, if any. It is only present if the request method is POST.
$contentType  : string|null
The content type of the request. It is only present if the request is POST.
$error  : string|null
If there was an error, for instance if the body is JSON and could not be evaluated.
$headers  : array<string|int, mixed>|null
The headers sent in the request. If no header is defined, this field is not present.
$method  : string|null
The HTTP method, currently GET, POST or PUT.
$url  : string|null
The URL called when this message has been processed
from()  : static
Initializing a model from an array
getBody()  : string
Getter for body
getContentType()  : string
Getter for contentType
getError()  : string
Getter for error
getHeaders()  : array<string|int, mixed>
Getter for headers
getMethod()  : string
Getter for method
getUrl()  : string
Getter for url
jsonSerialize()  : array<string|int, mixed>
setBody()  : static
Setter for body
setContentType()  : static
Setter for contentType
setError()  : static
Setter for error
setHeaders()  : static
Setter for headers
setMethod()  : static
Setter for method
setUrl()  : static
Setter for url

Properties

$body

The body of the request, if any. It is only present if the request method is POST.

protected string|null $body = null

$contentType

The content type of the request. It is only present if the request is POST.

protected string|null $contentType = null

$error

If there was an error, for instance if the body is JSON and could not be evaluated.

protected string|null $error = null

$headers

The headers sent in the request. If no header is defined, this field is not present.

protected array<string|int, mixed>|null $headers = null

$method

The HTTP method, currently GET, POST or PUT.

protected string|null $method = null

$url

The URL called when this message has been processed

protected string|null $url = null

Methods

from()

Initializing a model from an array

public static from(array<string|int, mixed> $params) : static
Parameters
$params : array<string|int, mixed>

Pass this parameter if you want to initial property value from an array. See API reference for all property names and types

Tags
throws
DeserializeException

If provided an invalid type to a property

Return values
static

getBody()

Getter for body

public getBody() : string
Return values
string

The body of the request, if any. It is only present if the request method is POST.

getContentType()

Getter for contentType

public getContentType() : string
Return values
string

The content type of the request. It is only present if the request is POST.

getError()

Getter for error

public getError() : string
Return values
string

If there was an error, for instance if the body is JSON and could not be evaluated.

getHeaders()

Getter for headers

public getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

The headers sent in the request. If no header is defined, this field is not present.

getMethod()

Getter for method

public getMethod() : string
Return values
string

The HTTP method, currently GET, POST or PUT.

getUrl()

Getter for url

public getUrl() : string
Return values
string

The URL called when this message has been processed

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

setBody()

Setter for body

public setBody(string $body) : static
Parameters
$body : string

The body of the request, if any. It is only present if the request method is POST.

Return values
static

To use in method chains

setContentType()

Setter for contentType

public setContentType(string $contentType) : static
Parameters
$contentType : string

The content type of the request. It is only present if the request is POST.

Return values
static

To use in method chains

setError()

Setter for error

public setError(string $error) : static
Parameters
$error : string

If there was an error, for instance if the body is JSON and could not be evaluated.

Return values
static

To use in method chains

setHeaders()

Setter for headers

public setHeaders(array<string|int, mixed> $headers) : static
Parameters
$headers : array<string|int, mixed>

The headers sent in the request. If no header is defined, this field is not present.

Return values
static

To use in method chains

setMethod()

Setter for method

public setMethod(string $method) : static
Parameters
$method : string

The HTTP method, currently GET, POST or PUT.

Return values
static

To use in method chains

setUrl()

Setter for url

public setUrl(string $url) : static
Parameters
$url : string

The URL called when this message has been processed

Return values
static

To use in method chains

Search results