You are here

public function RequestInterface::withMethod in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/psr/http-message/src/RequestInterface.php \Psr\Http\Message\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

self

Throws

\InvalidArgumentException for invalid HTTP methods.

3 methods override RequestInterface::withMethod()
Request::withMethod in vendor/guzzlehttp/psr7/src/Request.php
Return an instance with the provided HTTP method.
ServerRequest::withMethod in vendor/zendframework/zend-diactoros/src/ServerRequest.php
Set the request method.
ServerRequest::withMethod in vendor/symfony/psr-http-message-bridge/Tests/Fixtures/ServerRequest.php
Return an instance with the provided HTTP method.

File

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

Class

RequestInterface
Representation of an outgoing, client-side request.

Namespace

Psr\Http\Message

Code

public function withMethod($method);