Hi Everyone,

I am new to HttpClient, and I am a little confused regarding a few issues.  
Here are my issues:

1.  What is the best way to take care of relative redirects. I am basically 
adding a method that will check the redirect path and if path is relative, then 
it would add the server's url, or the url of the context to the beginning of 
the path.   My question is what is the best way to get my hand on the server's 
url and the context's url.  I could pass these values in, but I want to be able 
to retrieve these values from one of the classes in the HttpClient rather than 
pass them in.  After all, they must be stored somewhere like in the HttpMethod 
that is being executed. Also, please let me know if there is better way of 
handling relative redirects.

2. HttpResponse class.  This class seems to have a lot of interesting such as . 
 However, I can't find any way of obtaining the HttpResponse instance 
associated with a method that I have just executed.  I execute my method in the 
following way:

HttpClient httpClient = new HttpClient();
GetMethod getMethod = new GetMethod(url);
getMethod.setFollowRedirects(true); 
int responseCode = httpClient.executeMethod(getMethod);

Now, how can I obtain a reference to the HttpResponse associated with the 
method executed above?

3.  When I look at the latest API, there is no HttpResponse, but when I search 
through mailing list or web, I get a lot of posting that includes references to 
HttpResponse.  Is HttpResponse somehow deprecated or something?  


Thanks for taking time time to respond to my post.
Dan



 
---------------------------------
 Get your own web address.
 Have a HUGE year through Yahoo! Small Business.

Reply via email to