Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MessageInterface.php

function 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

static

Throws

\InvalidArgumentException for invalid header names or values.

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(string $name, $value) : MessageInterface;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal