src/Http/ServerRequest.php
public function withMethod($method)
    {
        if (!in_array((string)$method, $this->allowed_methods)) {
            throw new InvalidArgumentException(sprintf(
                'HTTP method is invalid. Must be of : %s',
                implode(', ', $this->allowed_methods)
            ));
        }

        $server_request = clone $this;
        $server_request->params['REQUEST_METHOD'] = (string)$method;

        return $server_request;
    }
public function withMethod($method)
    {
        if (!in_array((string)$method, $this->allowed_methods)) {
            throw new InvalidArgumentException(sprintf(
                'HTTP method is invalid. Must be of : %s',
                implode(', ', $this->allowed_methods)
            ));
        }

        $server_request = clone $this;
        $server_request->params['REQUEST_METHOD'] = (string)$method;

        return $server_request;
    }
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.

@param string $method Case-sensitive method.
@return RequestInterface
@throws \InvalidArgumentException for invalid HTTP methods.