Code example for HttpRequest

Methods: getParams

0
                                           HttpRequest request,
                                           HttpContext context)
        throws HttpException { 
 
        if (target == null) {
            target = (HttpHost) request.getParams().getParameter(
                ClientPNames.DEFAULT_HOST);
        } 
        if (target == null) {
            // BEGIN android-changed 
            //     If the URI was malformed, make it obvious where there's no host component 
            String scheme = null;
            String host = null;
            String path = null;
            URI uri;
            if (request instanceof HttpUriRequest
                    && (uri = ((HttpUriRequest) request).getURI()) != null) {
                scheme = uri.getScheme();
                host = uri.getHost();
                path = uri.getPath();
            } 
            throw new IllegalStateException( "Target host must not be null, or set in parameters."
                    + " scheme=" + scheme + ", host=" + host + ", path=" + path);
            // END android-changed 
        } 
 
        return this.routePlanner.determineRoute(target, request, context);
    } 
 
 
    /** 
     * Establishes the target route.