HumHub Documentation (unofficial)

AbstractMessage extends Message
in package

AbstractYes

HTTP standard message (Request/Response)

Tags
link
http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4

Table of Contents

Constants

VERSION_10  = '1.0'
VERSION_11  = '1.1'
VERSION_2  = '2'

Properties

$content  : mixed
$headers  : Headers|null
$metadata  : array<string|int, mixed>
$version  : string

Methods

__toString()  : string
Allow PHP casting of this object
getContent()  : mixed
Get message content
getHeaders()  : Headers
Return the header container responsible for headers
getMetadata()  : mixed
Retrieve all metadata or a single metadatum as specified by key
getVersion()  : string
Return the HTTP version for this request
setContent()  : Message
Set message content
setHeaders()  : $this
Provide an alternate Parameter Container implementation for headers in this object, (this is NOT the primary API for value setting, for that see getHeaders())
setMetadata()  : Message
Set message metadata
setVersion()  : $this
Set the HTTP version for this object, one of 1.0, 1.1 or 2 (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11, AbstractMessage::VERSION_2)
toString()  : string

Constants

Properties

$content

protected mixed $content = ''

$metadata

protected array<string|int, mixed> $metadata = []

Methods

__toString()

Allow PHP casting of this object

public __toString() : string
Return values
string

getContent()

Get message content

public getContent() : mixed

getMetadata()

Retrieve all metadata or a single metadatum as specified by key

public getMetadata([null|string|int $key = null ][, null|mixed $default = null ]) : mixed
Parameters
$key : null|string|int = null
$default : null|mixed = null
Tags
throws
InvalidArgumentException

getVersion()

Return the HTTP version for this request

public getVersion() : string
Return values
string

setContent()

Set message content

public setContent(mixed $value) : Message
Parameters
$value : mixed
Return values
Message

setHeaders()

Provide an alternate Parameter Container implementation for headers in this object, (this is NOT the primary API for value setting, for that see getHeaders())

public setHeaders(Headers $headers) : $this
Parameters
$headers : Headers
Tags
see
getHeaders()
Return values
$this

setMetadata()

Set message metadata

public setMetadata(string|int|array<string|int, mixed>|Traversable $spec[, mixed $value = null ]) : Message

Non-destructive setting of message metadata; always adds to the metadata, never overwrites the entire metadata container.

Parameters
$spec : string|int|array<string|int, mixed>|Traversable
$value : mixed = null
Tags
throws
InvalidArgumentException
Return values
Message

setVersion()

Set the HTTP version for this object, one of 1.0, 1.1 or 2 (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11, AbstractMessage::VERSION_2)

public setVersion(string $version) : $this
Parameters
$version : string

(Must be 1.0, 1.1 or 2)

Tags
throws
InvalidArgumentException
Return values
$this

toString()

public toString() : string
Return values
string

        
On this page

Search results