You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by sertac <se...@agmlab.com> on 2014/01/29 15:10:05 UTC
get ip via httpclient
hi all,
In my project, i have to use commons-http-client api which has version
3.1. I could not find any way to get ip address from host. Because of,
access modifier of Socket is protected.( HttpConnection.getSocket
method) I should not to inherit from this class.
I am using such as code block:
GetMethod get = new GetMethod("http://www.example.com");
get.setFollowRedirects(followRedirects);
get.setDoAuthentication(true);
params.makeLenient();
params.setContentCharset("UTF-8");
params.setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
params.setBooleanParameter(HttpMethodParams.SINGLE_COOKIE_HEADER, true);
code = Http.getClient().executeMethod(get);
Is there any way to get ip address into existing connection?
Thank you
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org