I'm following the example in the HttpClient documentation:

            DefaultHttpClient httpclient = new DefaultHttpClient();
            HttpContext localContext = new BasicHttpContext();
            HttpGet httpget = new HttpGet("http://www.google.com/";);
            HttpResponse response = httpclient.execute(httpget, localContext);
            HttpHost target = (HttpHost) localContext.getAttribute(
                    ExecutionContext.HTTP_TARGET_HOST);
            HttpUriRequest req = (HttpUriRequest) localContext.getAttribute(
                    ExecutionContext.HTTP_REQUEST);
            System.out.println("Target host: " + target);
            System.out.println("Final request URI: " + req.getURI());

I see the following output:

Target host: http://www.google.co.uk
Final request URI: /

However, I would expect to see an absolute URI, as per the Javadoc for
HttpUriRequest#getURI().

Is this a bug in the Javadoc (and user guide?) or a bug in the code?

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to