public function Request::getMethod

Same name in this branch

Gets the request method.

The method is always an uppercased string.

@api

Return value

string The request method

3 calls to Request::getMethod()
Request::isMethod in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php
Checks if the request method is of specified type.
Request::isMethodSafe in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php
Checks whether the method is safe or not.
Request::__toString in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php
Returns the request as a string.

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php, line 923

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

public function getMethod() {
  if (null === $this->method) {
    $this->method = strtoupper($this->server
      ->get('REQUEST_METHOD', 'GET'));
    if ('POST' === $this->method) {
      $this->method = strtoupper($this->headers
        ->get('X-HTTP-METHOD-OVERRIDE', $this->request
        ->get('_method', $this->query
        ->get('_method', 'POST'))));
    }
  }
  return $this->method;
}