Initialize request processing.

This sets home, host, and other request-related properties
based on current request URI.
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));
	}
207785
def init_get(self, request):
        
        self.request = request
        self.service = request.GET.get('service')
        self.url = request.GET.get('url')
        self.ajax = settings.CAS_ENABLE_AJAX_AUTH and 'HTTP_X_AJAX' in request.META
292828
public static void initialize() {
    String homeDirName = System.getProperty("jdcp.home");
    File homeDir;
    if (homeDirName != null) {
      homeDir = new File(homeDirName);
    } else {
      homeDir = FileUtil.getApplicationDataDirectory("jdcp");
      System.setProperty("jdcp.home", homeDir.getPath());
    }
    homeDir.mkdir();
    if (System.getProperty("derby.system.home") == null) {
      System.setProperty("derby.system.home", homeDir.getPath());
    }
  }
717970
function initialize(url) {
    this.socket = Requests[Requests.method](this);

    //
    // Open the socket BEFORE adding any properties to the instance as this might
    // trigger a thrown `InvalidStateError: An attempt was made to use an object
    // that is not, or is no longer, usable` error in FireFox:
    //
    // @see https://bugzilla.mozilla.org/show_bug.cgi?id=707484
    //
    this.socket.open(this.method.toUpperCase(), url, true);

    //
    // Register this as an active HTTP request.
    //
    Requests.active[this.id] = this;
  }
1070896
private void requestInitialized(ServletRequest request)
    {
        ServletRequestEvent event = new ServletRequestEvent(_servletContext,request);
        for (int i=0;i<LazyList.size(_requestListeners);i++)
            ((ServletRequestListener)LazyList.get(_requestListeners,i))
                        .requestInitialized(event);
    }
12693
def init(self):
        """"""
        self.debug('Initializing %r', self)
        proto = self.server.split('://')[0]

        if proto == 'https':
            if hasattr(ssl, 'create_default_context'):
                context = ssl.create_default_context()

                if self.ssl_verify:
                    context.check_hostname = True
                    context.verify_mode = ssl.CERT_REQUIRED
                else:
                    context.check_hostname = False
                    context.verify_mode = ssl.CERT_NONE

                self._http_handler = urllib2.HTTPSHandler(debuglevel=0, context=context)
            else:
                self._http_handler = urllib2.HTTPSHandler(debuglevel=0)
        elif proto == 'http':
            self._http_handler = urllib2.HTTPHandler(debuglevel=0)
        else:
            raise ValueError('Invalid protocol %s' % proto)

        self._api_url = self.server + '/api_jsonrpc.php'
        self._http_headers = {
            'Content-Type': 'application/json-rpc',
            'User-Agent': 'python/zabbix_api',
        }

        if self.httpuser:
            self.debug('HTTP authentication enabled')
            auth = self.httpuser + ':' + self.httppasswd
            self._http_headers['Authorization'] = 'Basic ' + b64encode(auth.encode('utf-8')).decode('ascii')
1311911
private function init_response_properties() {
		// Initialze some properties
		$this->response->status = null;
		$this->response->possible_methods = null;
		$this->response->message = null;
		$this->response->more_info = null;
		$this->response->data = null;
		$this->response->paging = null;
	}
245156
function init()
    {
        // initialize curl handle
        $this->ch = curl_init();

        //set various options

        //set error in case http return code bigger than 400
        if ($this->failonerror) {
            curl_setopt($this->ch, CURLOPT_FAILONERROR, true);
        }

        // allow redirects
        curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);

        // use gzip if possible
        curl_setopt($this->ch, CURLOPT_ENCODING, 'gzip, deflate');

        // do not veryfy ssl
        // this is important for windows
        // as well for being able to access pages with non valid cert
        curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
    }
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()
1252916
def initial(self, request, *args, **kwargs):
        
        self.format_kwarg = self.get_format_suffix(**kwargs)

        # Ensure that the incoming request is permitted
        self.perform_authentication(request)
        self.check_permissions(request)
        self.check_throttles(request)

        # Perform content negotiation and store the accepted info on the request
        neg = self.perform_content_negotiation(request)
        request.accepted_renderer, request.accepted_media_type = neg

        # Determine the API version, if versioning is in use.
        version, scheme = self.determine_version(request, *args, **kwargs)
        request.version, request.versioning_scheme = version, scheme
9673
@Override
	protected void setInitURI(String uriString) throws CadiException {
		try {
			initURI = new URI(uriString);
		} catch (URISyntaxException e) {
			throw new CadiException(e);
		}
	}
370044
private function setHostFromUri()
    {
        $this->hostFromUri = true;

        $host = $this->uri->getHost();

        if (!empty($host)) { // Do not set Host header if URI has no host.
            $port = $this->uri->getPort();
            if (null !== $port) {
                $host = sprintf('%s:%d', $host, $port);
            }

            parent::setHeader('Host', $host);
        }
    }
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
1340422
private function initializeOnDemand()
    {
        if ($this->initialized === false) {

            $this->initialized = true;
            $this->cache = $this->cacheMapper->fetchAll();

            // Run garbage collection on each HTTP request
            $this->gc();
        }
    }
412001
@SuppressWarnings("unchecked")
	public void requestInitialized(ServletRequestEvent sre) {
		WebContext<HttpServletRequest> context = (WebContext<HttpServletRequest>) container.component(container.contexts().get(Request.class));
		context.associate((HttpServletRequest) sre.getServletRequest());
	}
706785
def init(self):
        """"""
        self.url = self.url.format(host=self.host, port=self.port,
                                   api_key=self.api_key)
1105375
def process_request(self, request):
        
        if self._is_enabled():
            self._cache.set(self.guid_key, six.text_type(uuid4()))
            log_prefix = self._log_prefix(u"Before", request)
            self._cache.set(self.memory_data_key, self._memory_data(log_prefix))