Documentation

Response
in package

Table of Contents

Properties

$code  : int
$content  : string
$headers  : array<string|int, mixed>

Methods

addHeader()  : Response
Ads a header
getCode()  : int
Returns HTTP status code
getContent()  : string
Returns the content message
getHeaders()  : array<string|int, mixed>|null
Returns a header. Returns all headers if name is null
send()  : Response
Sends the headers and the content message
sendContent()  : Response
Sends the content message
sendHeaders()  : Response
Sends the headers
setCode()  : Response
Sets HTTP status code
setContent()  : Response
Sets content message
setHeader()  : Response
Sets a header. Deletes the header is value is null

Properties

$headers

private array<string|int, mixed> $headers = []

Methods

addHeader()

Ads a header

public addHeader(string $name, string $value) : Response
Parameters
$name : string
$value : string
Return values
Response

getCode()

Returns HTTP status code

public getCode() : int
Return values
int

getContent()

Returns the content message

public getContent() : string
Return values
string

getHeaders()

Returns a header. Returns all headers if name is null

public getHeaders([string $name = null ]) : array<string|int, mixed>|null
Parameters
$name : string = null
Return values
array<string|int, mixed>|null

setCode()

Sets HTTP status code

public setCode(int $code) : Response
Parameters
$code : int
Tags
throws
Exception
Return values
Response

setContent()

Sets content message

public setContent(string|int|float|null $content) : Response
Parameters
$content : string|int|float|null
Return values
Response

setHeader()

Sets a header. Deletes the header is value is null

public setHeader(string $name[, string $value = null ]) : Response
Parameters
$name : string
$value : string = null
Return values
Response

        
On this page

Search results