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

Breadcrumb

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

function RequestInterface::withMethod

Return an instance with the provided HTTP method.

While HTTP method names are typically all uppercase characters, HTTP method names are case-sensitive and thus implementations SHOULD NOT modify the given string.

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 changed request method.

Parameters

string $method Case-sensitive method.:

Return value

static

Throws

\InvalidArgumentException for invalid HTTP methods.

1 method overrides RequestInterface::withMethod()
Request::withMethod in vendor/guzzlehttp/psr7/src/Request.php
Return an instance with the provided HTTP method.

File

vendor/psr/http-message/src/RequestInterface.php, line 86

Class

RequestInterface
Representation of an outgoing, client-side request.

Namespace

Psr\Http\Message

Code

public function withMethod(string $method) : RequestInterface;

API Navigation

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