Initialize the request instance variable and add a default "not found" route.
 TODO: Code Climate says this method is too big.
174612
def process_request
      verb = request.request_method
      path = request.path

      # In RackStep, each request is processed by a controller. The router
      # is responsable to find, based on the given path and http verb,
      # the apropriate controller to handle the request.
      route = router.find_route_for(path, verb)
      # Initialize the correspondent controller.
      controller = route.controller.new
      # Inject the request into the controller.
      controller.request = request
      # Execute the before method of this controller.
      controller.send(:before)
      # Execute the apropriate method/action.
      controller.send(:process_request)
      # Execute the after method of this controller.
      controller.send(:after)
      # Get from the controller what is the response for this request.
      response = controller.response

      return response
    end
106579
@Override
  protected void initRequest()
  {
    super.initRequest();
    
    _state = _state.toActive();
    
    // HttpBufferStore httpBuffer = getHttpBufferStore();
    HttpBufferStore bufferStore = getHttpBufferStore();

    _method.clear();
    _methodString = null;
    _protocol.clear();

    _uriLength = 0;
    if (bufferStore == null) {
      // server/05h8
      _uri = getSmallUriBuffer(); // httpBuffer.getUriBuffer();
      
      _headerBuffer = getSmallHeaderBuffer(); // httpBuffer.getHeaderBuffer();
      _headerKeys = getSmallHeaderKeys();     // httpBuffer.getHeaderKeys();
      _headerValues = getSmallHeaderValues(); // httpBuffer.getHeaderValues();
    }

    _uriHost.clear();
    _host = null;
    _keepalive = KeepaliveState.INIT;

    _headerSize = 0;
    _headerLength = 0;
    
    _inOffset = 0;
    _isChunkedIn = false;
    _isFirst = true;
  }
1353741
def initialize(self, method, middleware, request_type):
        
        self.method = method
        self.middleware = middleware
        self.request_type = request_type
305409
def handle_not_found(exception, **extra):
    """"""
    assert isinstance(exception, NotFound)

    page = Page.query.filter(db.or_(Page.url == request.path,
                                    Page.url == request.path + "/")).first()

    if page:
        _add_url_rule(page.url)
        return render_template(
            [
                page.template_name,
                current_app.config['PAGES_DEFAULT_TEMPLATE']
            ],
            page=page
        )
    elif 'wrapped' in extra:
        return extra['wrapped'](exception)
    else:
        return exception
938965
private static void addParameterIfNotNull(Request<?> request, String paramName, String paramValue) {
        if (paramValue != null) {
            request.addParameter(paramName, paramValue);
        }
    }
362664
public function initializeObject()
    {
        if ($this->request === null) {
            $httpRequest = Request::createFromEnvironment();
            $this->request = $this->objectManager->get(\TYPO3\Flow\Mvc\ActionRequest::class, $httpRequest);
        }

        $uriBuilder = new UriBuilder();
        $uriBuilder->setRequest($this->request);

        $this->setControllerContext(new ControllerContext(
            $this->request,
            new Response(),
            new Arguments(array()),
            $uriBuilder
        ));
    }
13433
def initialize_context(self, request: HttpRequest, *args, **kwargs) -> None:
        
        for key in self.CONTEXT_KEYS:
            setattr(self, key, kwargs.get(key))
        for key in self.QUERY_CONTEXT_KEYS:
            setattr(self, key, request.query_params.get(key))
        self._initialize_context()
        self.validate_context()
1338858
public void initializeRelativePath(ServletRequest request, String relativeTo) 
    {
        if ( relativeTo == null )
        {
            relativeTo = _relativeTo;
        }

        if ( relativeTo == null ) return;

        assert ! relativeTo.endsWith("/") : relativeTo;
        String path = getPath();
         
        // If this is a local (relative) path, prefix it with the given 'relativeTo' path, and save a flag.
        // We save this flag in a local variable because the Forward object may be saved/restored for use again.
        if (! getContextRelative() && ! FileUtils.isAbsoluteURI(path)) {
            assert path.startsWith("/") : path;
            setPath(relativeTo + path);
            setContextRelative(true);
            _outsidePageFlowDirectory = true;
        }
        
        // Store a flag in the request that will prevent another page flow from being initialized implicitly because
        // we're hitting a path within it.  We want to stay in the context of the current page flow.
        if (_outsidePageFlowDirectory) {
            PageFlowRequestWrapper.get(request).setStayInCurrentModule(true);
        }
    }
1260363
def insert_route(**kw):
    
    binding = {
            'path': None,
            'node_id': None,
            'weight': None,
            'method': "GET"
            }
    binding.update(kw)
    with current_app.app_context():
        db.execute(text(fetch_query_string('insert_route.sql')), **binding)
502908
protected void initRequest()
  {
    _hostHeader = null;
    _xForwardedHostHeader = null;
    _expect100Continue = false;

    _cookies.clear();

    _contentLengthIn = -1;

    _hasReadStream = false;

    _readEncoding = null;

    //_request = request;
    //_requestFacade = getHttp().createFacade(this);
    
    _startTime = -1;
    _expireTime = -1;
    
    _isUpgrade = false;
    
    _statusCode = 200;
    _statusMessage = "OK";

    _headerKeysOut.clear();
    _headerValuesOut.clear();
    
    _contentTypeOut = null;
    _contentEncodingOut = null;
    _contentLengthOut = -1;

    _footerKeys.clear();
    _footerValues.clear();

    out().start();

    _isHeaderWritten = false;

    _isClosed = false;
    //_serverHeader = http().serverHeader();
    
    _isKeepalive = true;
  }
934095
public function initializeObject()
    {
        if ($this->request === null) {
            $requestHandler = $this->bootstrap->getActiveRequestHandler();
            if ($requestHandler instanceof HttpRequestHandlerInterface) {
                $this->request = new ActionRequest($requestHandler->getHttpRequest());
            } else {
                $httpRequest = Request::createFromEnvironment();
                $this->request = new ActionRequest($httpRequest);
            }
        }

        $uriBuilder = new UriBuilder();
        $uriBuilder->setRequest($this->request);

        $this->setControllerContext(new ControllerContext(
            $this->request,
            new ActionResponse(),
            new Arguments([]),
            $uriBuilder
        ));
    }
1194780
def add_route(self, route):
        ''' '''
        self.routes.append(route)
        self.router.add(route.rule, route.method, route, name=route.name)
        if DEBUG: route.prepare()
373516
protected void init(VaadinRequest request) {


        RDFUnitDemoSession.init("http://" + getClientIpAddr(request));

        initLayout();
        setPollInterval(15000);

        mainTab.addTab(new IntroTab(), "Introduction");
        mainTab.addTab(new EndpointTestTab(), "Test RDF Data");
        mainTab.setSelectedTab(1);

        // When user exits (window close, loose session) stop background threads
        this.addDetachListener((DetachListener) event -> {
            RDFUnitDemoSession.getTestExecutor().cancel();
            RDFUnitDemoSession.getTestGeneratorExecutor().cancel();
        });

    }
355883
static function Init()
	{
		require_once 'verysimple/Phreeze/Controller.php';
		require_once 'verysimple/HTTP/RequestUtil.php';

		if (!self::$IS_INITIALIZED)
		{
			RequestUtil::NormalizeUrlRewrite();

			Controller::$SmartyViewPrefix = '';
			Controller::$DefaultRedirectMode = 'header';

			self::$IS_INITIALIZED = true;
		}

	}
732397
protected function initRoutes()
    {
        if (isset($this->settings) && $this->settings->exists('routes') || !self::$init_stages[$this->name]['routes']) {

            $routes = $this->settings->get('routes');

            // Get uncamelized app name
            $string = new CamelCase($this->name);
            $app = $string->uncamelize();

            // Add always a missing index route!
            if (!array_key_exists('index', $routes)) {
                $routes['index'] = [];
            }

            foreach ($routes as $name => $definition) {

                if (is_numeric($name)) {
                    Throw new AppException(sprintf('AbstractApp "%s" sent a nameless route to be mapped.', $this->name));
                }

                $definition = $this->parseRouteDefintion($name, $definition);

                $this->core->router->map($definition['method'], $definition['route'], $definition['target'], $definition['name']);
            }

            self::$init_stages[$this->name]['routes'] = true;
        }
    }
483686
private function init_request() {

		$this->autodetect_home();

		$this->autodetect_host();

		# initialize from request uri
		$url = isset($_SERVER['REQUEST_URI'])
			? $_SERVER['REQUEST_URI'] : '';

		# remove query string
		$rpath = parse_url($url)['path'];

		# remove home
		if ($rpath != '/')
			$rpath = substr($rpath, strlen($this->home) - 1);

		# trim slashes
		$rpath = trim($rpath, "/");

		# store in private properties
		$this->request_path = '/' . $rpath;
		$this->request_comp = explode('/', $rpath);
		self::$logger->debug(sprintf(
			"Router: request path: '%s'.",
			$this->request_path));
	}
691809
def _initialize(self, request):
        """"""

        # Add node information on the first request dispatched on a stream.
        request.node.MergeFrom(self._node)
        request.resource.MergeFrom(self._resource)
        self._initial_request = request

        self._rpc.open()
        self._initialized = True