Message Class
Aurora\Http Namespace
Interfaces
- I MessageInterface
Properties
headers
Headers array
protected $headers = []: array
headerNames
Header names array
protected $headerNames = []: array
protocol
HTTP protocol version
protected $protocol = '1.1': string
stream
Body stream
protected $stream: \StreamInterface
Methods
getProtocolVersion
Retrieves the HTTP protocol version as a string
Return Value
string
Signature
public function getProtocolVersion()
withProtocolVersion
Return an instance with the specified HTTP protocol version
Parameters
-
mixed
$version
— HTTP protocol version
Return Value
\Message
Signature
public function withProtocolVersion(mixed $version)
getHeaders
Retrieves all message header values
Return Value
array
Signature
public function getHeaders()
hasHeader
Checks if a header exists by the given case-insensitive name
Parameters
-
mixed
$name
— Case-insensitive header field name
Return Value
bool
Signature
public function hasHeader(mixed $name)
getHeader
Retrieves a message header value by the given case-insensitive name
Parameters
-
mixed
$name
— Case-insensitive header field name
Return Value
array
Signature
public function getHeader(mixed $name)
getHeaderLine
Retrieves a comma-separated string of the values for a single header
Parameters
-
mixed
$name
— Case-insensitive header field name
Return Value
string
Signature
public function getHeaderLine(mixed $name)
withHeader
Return an instance with the provided value replacing the specified header
Parameters
-
mixed
$name
— Case-insensitive header field name -
mixed
$value
— Header value(s)
Return Value
\Message
Signature
public function withHeader(mixed $name, mixed $value)
withAddedHeader
Return an instance with the specified header appended with the given value
Parameters
-
mixed
$name
— Case-insensitive header field name to add -
mixed
$value
— Header value(s)
Return Value
\Message
Signature
public function withAddedHeader(mixed $name, mixed $value)
withoutHeader
Return an instance without the specified header
Parameters
-
mixed
$name
— Case-insensitive header field name to remove
Return Value
\Message
Signature
public function withoutHeader(mixed $name)
getBody
Gets the body of the message
Return Value
\StreamInterface
Signature
public function getBody()
withBody
Return an instance with the specified message body
Parameters
-
Psr\Http\Message\StreamInterface
$body
— Body
Return Value
\Message
Signature
public function withBody(Psr\Http\Message\StreamInterface $body)
setHeaders
Set message headers
Parameters
-
array
$headers
— Headers array
Signature
protected function setHeaders(array $headers): void