Get the HTTP request method.

@param boolean $allowOverride Allow method override in POST request?
@return string The name of the HTTP request method being used.
172745
public function getMethod($allowOverride = true)
	{
		if($allowOverride && $this->methodOverride !== NULL && $this->method == Http::METHOD_POST)
		{
			return $this->methodOverride;
		}
		
		return $this->method;
	}
1199994
protected function get_user_oauth_client($overrideurl = false) {
        if ($this->client) {
            return $this->client;
        }
        if ($overrideurl) {
            $returnurl = $overrideurl;
        } else {
            $returnurl = new moodle_url('/repository/repository_callback.php');
            $returnurl->param('callback', 'yes');
            $returnurl->param('repo_id', $this->id);
            $returnurl->param('sesskey', sesskey());
        }
        $this->client = \core\oauth2\api::get_user_oauth_client($this->issuer, $returnurl, self::SCOPES);
        return $this->client;
    }
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;
    }
1074783
private function getOverrideMethod(ServerRequestInterface $request)
    {
        if ($request->getMethod() === 'POST' && $this->postParam !== null) {
            $params = $request->getParsedBody();

            if (isset($params[$this->postParam])) {
                return strtoupper($params[$this->postParam]);
            }
        } elseif ($request->getMethod() === 'GET' && $this->getParam !== null) {
            $params = $request->getQueryParams();

            if (isset($params[$this->getParam])) {
                return strtoupper($params[$this->getParam]);
            }
        }

        return strtoupper($request->getHeaderLine(self::HEADER));
    }
1027985
public function getDatabaseInfo(ServiceDbInterface $instance = null, $allow_override = true)
    {
        if (!isset($instance)) {
            /** @var EngineType $engine */
            $engine = $this->getEngineInstance();
            $instance = $engine->getServiceInstanceByInterface(
                ServiceDbInterface::class
            );

            if ($instance === false) {
                throw new \RuntimeException(
                    'Unable to find a service for the database instance.'
                );
            }
        }
        $database = $this->getServiceInstanceDatabase($instance);

        if (!$allow_override || !isset($this->databaseOverride)) {
            return $database;
        }

        // Process database overrides on the current db object.
        foreach (get_object_vars($this->databaseOverride) as $property => $value) {
            if (empty($value)) {
                continue;
            }
            $method = 'set' . ucwords($property);

            if (!method_exists($database, $method)) {
                continue;
            }
            $database = call_user_func_array(
                [$database, $method],
                [$value]
            );
        }

        return $database;
    }
461336
protected function getCurlOptArray($override = array())
    {
        $opt = array();

        $opt[CURLOPT_HEADER]         = false;
        $opt[CURLOPT_USERAGENT]      = 'ShopgatePlugin/' . (defined(
                'SHOPGATE_PLUGIN_VERSION'
            )
                ? SHOPGATE_PLUGIN_VERSION
                : 'called outside plugin');
        $opt[CURLOPT_RETURNTRANSFER] = true;
        $opt[CURLOPT_SSL_VERIFYPEER] = true; // *always* verify peers, otherwise MITM attacks are trivial
        // Use value of CURL_SSLVERSION_TLSv1_2 for CURLOPT_SSLVERSION, because it is not available before PHP 5.5.19 / 5.6.3
        // Actual usage of TLS 1.2 (which is required by PCI DSS) depends on PHP cURL extension and underlying SSL lib
        $opt[CURLOPT_SSLVERSION] = 6;
        $opt[CURLOPT_HTTPHEADER] = array(
            'X-Shopgate-Library-Version: ' . SHOPGATE_LIBRARY_VERSION,
            'X-Shopgate-Plugin-Version: ' . (defined(
                'SHOPGATE_PLUGIN_VERSION'
            )
                ? SHOPGATE_PLUGIN_VERSION
                : 'called outside plugin'),
        );
        $opt[CURLOPT_HTTPHEADER] = !empty($opt[CURLOPT_HTTPHEADER])
            ? ($this->authService->getAuthHttpHeaders() + $opt[CURLOPT_HTTPHEADER])
            : $this->authService->getAuthHttpHeaders();
        $opt[CURLOPT_TIMEOUT]    = 30; // Default timeout 30sec
        $opt[CURLOPT_POST]       = true;

        return ($override + $opt);
    }
647113
public function getDeviceForHttpRequest($httpRequest, $override_sideloaded_browser_ua = true)
    {
        if (!isset($httpRequest)) {
            throw new Exception("The $httpRequest parameter must be set.");
        }
        $request = $this->_requestFactory->createRequest($httpRequest, $override_sideloaded_browser_ua);
        return $this->getDeviceForRequest($request);
    }
306598
public function get($tag, $override = true)
    {
        if (!$this->freeze) {
            throw new AssertionException('Usage of '.__CLASS__.'::get() is only allowed in beforeCompile. Also make sure that '.__CLASS__.' is registered before all extensions which use it.');
        }
        if ($override && isset($this->overrides[$tag])) {
            return $this->overrides[$tag];
        }
        if (!isset($this->tags[$tag])) {
            throw new AssertionException("Tag '$tag' is not registered.");
        }

        return $this->prefixTag($tag);
    }
894633
public function getMethod()
    {
        if (empty($this->method)) {
            $this->method = strtolower($this->httpRequest()->getRequestMethod());
        }

        return $this->method;
    }
741799
public static function get_method() {
	if (empty($_SERVER['REQUEST_METHOD'])) {
		return 'GET';
	}
	
	$allowed_methods = ['GET', 'PUT', 'POST', 'PATCH', 'DELETE', 'OPTIONS', 'HEAD'];
	if (in_array($_SERVER['REQUEST_METHOD'], $allowed_methods) == false) {
		return false;
	}
	
	return $_SERVER['REQUEST_METHOD'];
}
867573
public function getRequestMethod()
    {
        if (isset($this->request->server['http_x_http_method_override'])) {
            return strtoupper($this->request->server['http_x_http_method_override']);
        }
        if (isset($this->request->server['request_method'])) {
            return strtoupper($this->request->server['request_method']);
        }

        return 'GET';
    }
664510
private function getHttpMethod(): string
    {
        if (!empty($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
            $method = mb_strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
        } else {
            $method = mb_strtoupper($_SERVER['REQUEST_METHOD']);
        }

        switch ($method) {
            case 'GET':
                return static::HTTP_METHOD_GET;
            case 'HEAD':
                return static::HTTP_METHOD_HEAD;
            case 'POST':
                return static::HTTP_METHOD_POST;
            case 'OPTIONS':
                return static::HTTP_METHOD_OPTIONS;
            case 'CONNECT':
                return static::HTTP_METHOD_CONNECT;
            case 'TRACE':
                return static::HTTP_METHOD_TRACE;
            case 'PUT':
                return static::HTTP_METHOD_PUT;
            case 'DELETE':
                return static::HTTP_METHOD_DELETE;
            default:
                return static::HTTP_METHOD_UNKNOWN;
        }
    }
426578
public static function method($default = 'GET')
	{
		// get the method from the current active request
		if ($request = \Request::active() and $method = $request->get_method())
		{
			return $method;
		}

		// if called before a request is active, fall back to the global server setting
		if (\Config::get('security.allow_x_headers', false))
		{
			return \Input::server('HTTP_X_HTTP_METHOD_OVERRIDE', \Input::server('REQUEST_METHOD', $default));
		}
		else
		{
			return \Input::server('REQUEST_METHOD', $default);
		}
	}
624860
public static function getRequestAction()
    {
        $r = explode('/', ltrim(self::getRequestRoute(), '/'));
        return (isset($r[1]) && !empty($r[1])) ? $r[1] : false;
    }
95936
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') {
                $body = $this->getParsedBody();

                if (is_object($body) && property_exists($body, '_METHOD')) {
                    $this->method = $this->filterMethod($body->_METHOD);
                } elseif (is_array($body) && isset($body['_METHOD'])) {
                    $this->method = $this->filterMethod($body['_METHOD']);
                }

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

        return $this->method;
    }
1059687
private PostMethod getRequestMethod(boolean refresh, String id) throws UnsupportedEncodingException {
		GOCTransport gocTransport = new GOCTransport();
		EndpointInfo endpointInfo = gocTransport.getEndpointInfo(_config, _logger, refresh);

		// Create upsert URI with PATCH method
		PostMethod post = new PostMethod(String.format("%s/services/data/v25.0/sobjects/SM_Alert__c/%s/%s", endpointInfo.getEndPoint(),
				urlEncode(GOCData.SM_ALERT_ID__C_FIELD), urlEncode(id))) {

			@Override
			public String getName() {
				return "PATCH";
			}
		};
		post.setRequestHeader("Authorization", "Bearer " + endpointInfo.getToken());
		return post;
	}
572714
protected function detectMethod(HttpRequest $request)
	{
		$requestMethod = $request->getMethod();
		if ($requestMethod !== 'POST') {
			return $request->getMethod();
		}

		$method = $request->getHeader(self::HTTP_HEADER_OVERRIDE);
		if (isset($method)) {
			return strtoupper($method);
		}

		$method = $request->getQuery(self::QUERY_PARAM_OVERRIDE);
		if (isset($method)) {
			return strtoupper($method);
		}

		return $requestMethod;
	}