You are here

public function MessageInterface::withBody in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/psr/http-message/src/MessageInterface.php \Psr\Http\Message\MessageInterface::withBody()

Return an instance with the specified message body.

The body MUST be a StreamInterface object.

This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return a new instance that has the new body stream.

Parameters

StreamInterface $body Body.:

Return value

self

Throws

\InvalidArgumentException When the body is not valid.

1 method overrides MessageInterface::withBody()
Message::withBody in vendor/symfony/psr-http-message-bridge/Tests/Fixtures/Message.php
Return an instance with the specified message body.

File

vendor/psr/http-message/src/MessageInterface.php, line 186

Class

MessageInterface
HTTP messages consist of requests from a client to a server and responses from a server to a client. This interface defines the methods common to each.

Namespace

Psr\Http\Message

Code

public function withBody(StreamInterface $body);