mini\Http\Message\Request::withAddedHeader() Method

public

Signature

public function withAddedHeader($name, $value): Psr\Http\Message\MessageInterface

Parameters

Name Type Default Description
$name mixed required Documentation missing
$value mixed required Documentation missing

Returns

Psr\Http\Message\MessageInterface

Documentation

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.

Source

src/Http/Message/MessageTrait.php:194-204