Get HTTP method

@return string
@api
359222
public function getMethod()
    {
        // Get actual request method
        $method = $this->env->get('REQUEST_METHOD');
        $methodOverride = $this->headers->get('HTTP_X_HTTP_METHOD_OVERRIDE');

        // Detect method override (by HTTP header or POST parameter)
        if (!empty($methodOverride)) {
            $method = strtoupper($methodOverride);
        } else if ($method === static::METHOD_POST) {
            $customMethod = $this->post(static::METHOD_OVERRIDE, false);
            if ($customMethod !== false) {
                $method = strtoupper($customMethod);
            }
        }

        return $method;
    }
294939
public function getMethod() 
    {
        $this->method || $this->method = strtoupper($this->getServer('REQUEST_METHOD'));
        
        return $this->method;
    }
1231296
public function getMethod() : ?string 
    {
        if ( ! $this->hasMethod()) {
            $this->setMethod($this->getDefaultMethod());
        }
        return $this->method;
    }
1263270
public static function method() {
        // $this->methodParam 默认值为 '_method'
        // 如果指定 $_POST['_method'] ，表示使用POST请求来模拟其他方法的请求。
        // 此时 $_POST['_method'] 即为所模拟的请求类型。
        if (isset($_POST[$this->methodParam])) {
            return strtoupper($_POST[$this->methodParam]);
            // 或者使用 $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] 的值作为方法名。
        } elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
            return strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
            // 或者使用 $_SERVER['REQUEST_METHOD'] 作为方法名，未指定时，默认为 GET 方法
        } else {
            return isset($_SERVER['REQUEST_METHOD']) ? strtoupper($_SERVER['REQUEST_METHOD']) : 'GET';
        }
    }
631947
public static function getHTTPMethods() {
        return[
            self::HTTP_METHOD_DELETE,
            self::HTTP_METHOD_GET,
            self::HTTP_METHOD_HEAD,
            self::HTTP_METHOD_OPTIONS,
            self::HTTP_METHOD_PATCH,
            self::HTTP_METHOD_POST,
            self::HTTP_METHOD_PUT,
        ];
    }
544926
private function getInputFromHTTP() {
		if($this->logger) $this->logger->debug('Getting and decoding HTTP request body');
		$input = file_get_contents('php://input');
		$this->setInput($input);
		return $this->input;
	}
1322527
public function getHttpHost()
    {
        if (isset($_SERVER['HTTP_HOST'])
            && isset($_SERVER['SERVER_NAME'])
            && $_SERVER['HTTP_HOST'] === $_SERVER['SERVER_NAME']
        ) {
            return $_SERVER['HTTP_HOST'];
        }

        if (isset($_SERVER['HTTP_HOST'])) {
            return $_SERVER['HTTP_HOST'];
        }

        // This is the least reliable, due to the ability to spoof it
        if (isset($_SERVER['SERVER_NAME'])) {
            return $_SERVER['SERVER_NAME'];
        }

        return null;
    }
488882
public function receiveMethod()
    {
        if ($requestMethod = (isset($_SERVER['REQUEST_METHOD'])) ? $_SERVER['REQUEST_METHOD'] : null) {
            $requestMethod = strtoupper($requestMethod);
        }

        return $requestMethod;
    }
992084
def get_http_method(self, method):
        """"""
        return self.http_methods[method](self.url, **self.http_method_args)
557829
public function getMethod()
    {
        if (null !== $this->method) {
            return $this->method;
        }

        // If the form was created from a button rather than the form node, check for HTML5 method override
        if ($this->button !== $this->node && $this->button->getAttribute('formmethod')) {
            return strtoupper($this->button->getAttribute('formmethod'));
        }

        return $this->node->getAttribute('method') ? strtoupper($this->node->getAttribute('method')) : 'GET';
    }
1195674
final public function getResponse()
    {
        if (empty($this->response)) {
            $httpMethod = $this->getRequest()
                ? strtoupper($this->getRequest()->getMethod())
                : 'GET'
            ;

            if ($this->isHttpMethodSupported($httpMethod)) {
                $functionName = $this->getFunctionName($httpMethod);
                Logger::get()->debug("Running responder method '$functionName'...");
                // If the responder is a restricted one...
                if ($this instanceof \Eix\Core\Responders\Restricted) {
                    // ... ensure the user is allowed to use that function.
                    Users::getCurrent()->checkAuthorisation($this, $functionName);
                }

                // The response is the result of executing the appropriate
                // responder function.
                $this->response = $this->$functionName();
            } else {
                throw new \Eix\Services\Net\Http\MethodNotAllowedException("This responder does not support {$httpMethod} requests.");
            }
        }

        return $this->response;
    }
755724
protected function getHttpClient()
    {
        if ($this->httpClient === null) {
            $this->httpClient = new Client($this->guzzle);
        }

        return $this->httpClient;
    }
1130433
public function getHttp()
    {
        if (is_null($this->http)) {
            $this->http = new Http();
        }

        if (count($this->http->getMiddlewares()) === 0) {
            $this->registerHttpMiddlewares();
        }

        return $this->http;
    }
569900
public function method()
    {
        // Return the emulated method from GET
        $emulated = filter_input(INPUT_GET, '_method', FILTER_SANITIZE_STRING);

        // Return the emulated method from POST
        if (!$emulated) {
            $emulated = filter_input(INPUT_POST, '_method', FILTER_SANITIZE_STRING);
        }

        // Set the emulated method
        if ($this->app->config('request.emulate') && $emulated) {
            return $emulated;
        }

        // Or the real method
        return $_SERVER['REQUEST_METHOD'];
    }
1054367
protected function getRestMethod()
    {
        $request = $this->getRequest();

        if (Request::getHttpMethodParameterOverride() || !$request->request->has('_method')) {
            return $request->getMethod();
        }

        return $request->request->get('_method');
    }
209710
private function getApiUrl()
    {
        $h = $this->secure === true ? 'https' : 'http';
        return sprintf('%s://%s/%s/', $h, $this->url, $this->version);
    }
1287475
public function getUrl()
    {
        $this->validateMethod();

        $apiVersion = UrlManipulator::forceSlashPrefix($this->apiVersion);
        $endpoint   = UrlManipulator::forceSlashPrefix($this->getEndpoint());

        $url = $apiVersion.$endpoint;

        if ($this->getMethod() !== 'POST') {
            $params = $this->getParams();
            $url = UrlManipulator::appendParamsToUrl($url, $params);
        }

        return $url;
    }