37 return $this->inner->getBodyAsStream();
51 return $this->inner->getBodyAsString();
64 return $this->inner->getBody();
76 $this->inner->setBody($body);
89 return $this->inner->getHeaders();
101 return $this->inner->hasHeader(
$name);
123 return $this->inner->getHeader(
$name);
140 return $this->inner->getHeaderAsArray(
$name);
157 $this->inner->setHeader(
$name, $value);
174 $this->inner->setHeaders($headers);
191 $this->inner->addHeader(
$name, $value);
205 $this->inner->addHeaders($headers);
222 return $this->inner->removeHeader(
$name);
236 $this->inner->setHttpVersion(
$version);
247 return $this->inner->getHttpVersion();
An exception for terminatinating execution or to throw for unit testing.
getHeaders()
Returns all the HTTP headers as an array.
getBodyAsString()
Returns the body as a string.
getHeaderAsArray($name)
Returns a HTTP header as an array.
addHeader($name, $value)
Adds a HTTP header.
setHttpVersion($version)
Sets the HTTP version.
trait MessageDecoratorTrait
This trait contains a bunch of methods, shared by both the RequestDecorator and the ResponseDecorator...
getBody()
Returns the message body, as it's internal representation.
getHttpVersion()
Returns the HTTP version.
hasHeader($name)
Will return true or false, depending on if a HTTP header exists.
addHeaders(array $headers)
Adds a new set of HTTP headers.
setBody($body)
Updates the body resource with a new stream.
setHeader($name, $value)
Updates a HTTP header.
setHeaders(array $headers)
Sets a new set of HTTP headers.
getHeader($name)
Returns a specific HTTP header, based on it's name.
removeHeader($name)
Removes a HTTP header.
getBodyAsStream()
Returns the body as a readable stream resource.