AbstractMessage
extends Message
in package
AbstractYes
HTTP standard message (Request/Response)
Tags
Table of Contents
Constants
- VERSION_10 = '1.0'
- VERSION_11 = '1.1'
- VERSION_2 = '2'
Properties
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
VERSION_10
public
mixed
VERSION_10
= '1.0'
VERSION_11
public
mixed
VERSION_11
= '1.1'
VERSION_2
public
mixed
VERSION_2
= '2'
Properties
$content
protected
mixed
$content
= ''
$headers
protected
Headers|null
$headers
$metadata
protected
array<string|int, mixed>
$metadata
= []
$version
protected
string
$version
= self::VERSION_11
Methods
__toString()
Allow PHP casting of this object
public
__toString() : string
Return values
stringgetContent()
Get message content
public
getContent() : mixed
getHeaders()
Return the header container responsible for headers
public
getHeaders() : Headers
Return values
HeadersgetMetadata()
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
getVersion()
Return the HTTP version for this request
public
getVersion() : string
Return values
stringsetContent()
Set message content
public
setContent(mixed $value) : Message
Parameters
- $value : mixed
Return values
MessagesetHeaders()
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
Return values
$thissetMetadata()
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
Return values
MessagesetVersion()
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
Return values
$thistoString()
public
toString() : string