Returns the method (POST / GET / PUT ... || CLI) of the current processed request.

@author Benjamin Carl <opensource@clickalicious.de>

@return string the method of current processed request (GET / POST / PUT ... || CLI)
488882
public function receiveMethod()
    {
        if ($requestMethod = (isset($_SERVER['REQUEST_METHOD'])) ? $_SERVER['REQUEST_METHOD'] : null) {
            $requestMethod = strtoupper($requestMethod);
        }

        return $requestMethod;
    }
294939
public function getMethod() 
    {
        $this->method || $this->method = strtoupper($this->getServer('REQUEST_METHOD'));
        
        return $this->method;
    }
1116363
public function getMethod()
    {
        if(!isset($this->_method) && isset($_SERVER['REQUEST_METHOD']))
        {
            $method = strtoupper($_SERVER['REQUEST_METHOD']);

            if($method == 'POST')
            {
                if($this->_headers->has('X-Http-Method-Override')) {
                    $method = strtoupper($this->_headers->get('X-Http-Method-Override'));
                }

                if($this->data->has('_method')) {
                    $method = strtoupper($this->data->get('_method', 'alpha'));
                }
            }

            $this->_method = $method;
        }

        return $this->_method;
    }
769964
protected function get_current_url()
    {
        // When running from commandline the REQUEST_URI is missing.
        if (!isset($_SERVER['REQUEST_URI'])) {
            return null;
        }

        // HTTP_HOST is a client-supplied header that is optional in HTTP 1.0
        $host = (!empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST']
            : (!empty($_SERVER['LOCAL_ADDR'])  ? $_SERVER['LOCAL_ADDR']
            : (!empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '')));

        $httpS = $this->isHttps() ? 's' : '';
        return "http{$httpS}://{$host}{$_SERVER['REQUEST_URI']}";
    }
209327
public function put()
    {
        $args = func_get_args();

        return $this->mapRoute($args)->via(\Yee\Http\Request::METHOD_PUT);
    }
866065
protected function _getOriginalRequest()
    {
        $request = $this->escort->request;
        $handler = $request->getParam('error_handler');

        if ($handler) {
            return $handler->request;
        }

        return $request;
    }
58844
public function getMethod()
    {
        if (null === $this->method) {
            $this->method = $this->getServer('REQUEST_METHOD', 'GET');
        }
        return $this->method;
    }
919323
public function getRequestInput()
    {
        if (isset($_REQUEST[$this->getModel()->getSlug()])) {
            return $_REQUEST[$this->getModel()->getSlug()];
        }
    }
800728
public static function getRequest(): Request
    {
        $serverArr = $_SERVER;

        if ('cli' === PHP_SAPI) {
            // If we're running off the CLI, we're going to set some default
            // settings.
            $serverArr['REQUEST_URI'] = $_SERVER['REQUEST_URI'] ?? '/';
            $serverArr['REQUEST_METHOD'] = $_SERVER['REQUEST_METHOD'] ?? 'CLI';
        }

        $r = self::createFromServerArray($serverArr);
        $r->setBody(fopen('php://input', 'r'));
        $r->setPostData($_POST);

        return $r;
    }
1163691
public function getMethod()
    {
        if ($this->method === null) {
            $this->method = $this->originalMethod;
            $customMethod = $this->getHeaderLine('X-Http-Method-Override');

            if ($customMethod) {
                $this->method = $this->filterMethod($customMethod);
            } elseif ($this->originalMethod === 'POST') {
                $overrideMethod = $this->filterMethod($this->getParsedBodyParam('_METHOD'));
                if ($overrideMethod !== null) {
                    $this->method = $overrideMethod;
                }

                if ($this->getBody()->eof()) {
                    $this->getBody()->rewind();
                }
            }
        }

        return $this->method;
    }
443972
public function method()
    {
        $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null;

        if ($method !== 'POST') {
            return $method;
        }

        if (array_key_exists('HTTP_X_HTTP_METHOD', $_SERVER)) {
            if (in_array($_SERVER['HTTP_X_HTTP_METHOD'], ['PUT', 'DELETE'])) {
                $method = $_SERVER['HTTP_X_HTTP_METHOD'];
            }
        }

        return $method;
    }
191139
public function getRequest()
    {
        if (null === $this->request) {
            @trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', \get_class($this).'::'.__FUNCTION__), E_USER_DEPRECATED);
            // throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
        }

        return $this->request;
    }
729437
public function post()
    {
        $args = func_get_args();

        return $this->mapRoute($args)->via(\Slim\Http\Request::METHOD_POST);
    }
304724
public function getMethod()
    {
        if ($this->method) {
            return $this->method;
        }

        $method = @$_SERVER['REQUEST_METHOD'];
        if (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']))
            $method = $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'];

        if (isset($_GET['_method']))
            $method = $_GET['_method'];
        else if (isset($_POST['_method']))
            $method = $_POST['_method'];

        $method = strtolower($method);

        if (!in_array($method, $this->methods))
            $method = 'get';

        return $method;

    }
237171
private function getMethod()
    {
        if (is_array($this->handler) && 2 === sizeof($this->handler)) {
            return $this->handler[1];
        }

        if ($this->isStaticMethod()) {
            list (, $method) = explode('::', $this->handler);

            return $method;
        }

        return '';
    }
402595
protected function getRequestMethod()
    {
        if (isset($this->server['REQUEST_METHOD'])) {
            // check for X-HTTP-Method-Override
            if (isset($this->server['HTTP_X_HTTP_METHOD_OVERRIDE']) && in_array($this->server['HTTP_X_HTTP_METHOD_OVERRIDE'], ['OPTIONS', 'GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'PATCH'])) {
                return $this->server['HTTP_X_HTTP_METHOD_OVERRIDE'];
            } else {
                return $this->server['REQUEST_METHOD'];
            }
        } else {
            return 'GET';
        }
    }
888983
protected function processProtocol()
    {
        $req = $this->request;
        $req->originalProtocol = $req->protocol = 'http-' . ( isset( $_SERVER['REQUEST_METHOD'] ) ? strtolower( $_SERVER['REQUEST_METHOD'] ) : "get" );

        // Adds support for using POST for PUT and DELETE for legacy browsers that does not support these.
        // If a post param "_method" is set to either PUT or DELETE, then ->protocol is changed to that.
        // (original protocol is kept on ->originalProtocol param)
        // Post is used as this is only meant for forms in legacy browsers.
        if ( $req->protocol === 'http-post' && isset( $_POST['_method'] ) )
        {
            $method = strtolower( $_POST['_method'] );
            if ( $method  === 'put' || $method === 'delete' )
                $req->protocol = "http-{$method}";

            unset( $_POST['_method'] );
        }
    }