Tuesday, July 5, 2011

Apache HttpClient and Charles Web Debugging Proxy

To set Charles Web Debugging Proxy to capture http traffic run from Apache HttpClient:

DefaultHttpClient client = new DefaultHttpClient();
// you can set various parameters for your client here.
// set up the proxy.
HttpHost proxy = new HttpHost("localhost", 8888);
client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);

No comments:

Post a Comment