AdamStipak\RestRoute::detectMethod PHP Method

detectMethod() protected method

protected detectMethod ( Nette\Http\IRequest $request ) : string
$request Nette\Http\IRequest
return string
    protected function detectMethod(IRequest $request)
    {
        $requestMethod = $request->getMethod();
        if ($requestMethod !== 'POST') {
            return $request->getMethod();
        }
        $method = $request->getHeader(self::METHOD_OVERRIDE_HTTP_HEADER);
        if (isset($method)) {
            return Strings::upper($method);
        }
        $method = $request->getQuery(self::METHOD_OVERRIDE_QUERY_PARAM);
        if (isset($method)) {
            return Strings::upper($method);
        }
        return $requestMethod;
    }