You are here

public function MessageInterface::withAddedHeader in Zircon Profile 8

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

Return an instance with the specified header appended with the given value.

Existing values for the specified header will be maintained. The new value(s) will be appended to the existing list. If the header did not exist previously, it will be added.

This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the new header and/or value.

Parameters

string $name Case-insensitive header field name to add.:

string|string[] $value Header value(s).:

Return value

self

Throws

\InvalidArgumentException for invalid header names or values.

1 method overrides MessageInterface::withAddedHeader()
Message::withAddedHeader in vendor/symfony/psr-http-message-bridge/Tests/Fixtures/Message.php
Return an instance with the specified header appended with the given value.

File

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

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 withAddedHeader($name, $value);