Code example for URI

Methods: isAbsolute

        // A null target may be acceptable if there is a default target. 
        // Otherwise, the null target is detected in the director. 
        HttpHost target = null;
        URI requestURI = request.getURI();
        if (requestURI.isAbsolute()) {
            target = URIUtils.extractHost(requestURI);
            if (target == null) {
                throw new ClientProtocolException(
                        "URI does not specify a valid host name: " + requestURI);
        return target;
    public final HttpResponse execute(HttpHost target, HttpRequest request)
        throws IOException, ClientProtocolException { 
        return execute(target, request, (HttpContext) null);