Your preferences have been saved!
» Using Http Client Inside Thread - import org.apache.commons.httpclient.URI; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.HostConfiguration; public class UsingHttpClientInsideThread {   public static void main(String args[]) throws Exception {     HttpClient client = new HttpClient();     client.getParams().setParameter("http.useragent", "Test Client");     HostConfiguration host = new HostConfiguration();     host.setHost(new URI("http://localhost:8080", true));... 16 Feb 12 » Get Cookie value and set cookie value - import org.apache.commons.httpclient.Cookie; import org.apache.commons.httpclient.HttpState; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.GetMethod; public class GetCookiePrintAndSetValue {   public static void main(String args[]) throws Exception {     HttpClient client = new HttpClient();     client.getParams().setParameter("http.useragent", "My Browser");     GetMethod method = new GetMethod("http://localhost:8080/");     try{... 16 Feb 12 » Basic Authentication Get JSP Method Return Code - import org.apache.commons.httpclient.URI; import org.apache.commons.httpclient.HttpState; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.Credentials; import org.apache.commons.httpclient.auth.AuthScope; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.HostConfiguration; import org.apache.commons.httpclient.UsernamePasswordCredentials; public class BasicAuthenticationGetJSPMethodReturnCode {... 16 Feb 12 » Basic Authentication For JSP Page - import org.apache.commons.httpclient.URI; import org.apache.commons.httpclient.HttpState; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.Credentials; import org.apache.commons.httpclient.auth.AuthScope; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.HostConfiguration; import org.apache.commons.httpclient.UsernamePasswordCredentials; public class BasicAuthenticationForJSPPage {... 16 Feb 12 » Basic Authentication Execute JSP Method - import org.apache.commons.httpclient.URI; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.HostConfiguration; public class BasicAuthenticationExecuteJSPMethod {   public static void main(String args[]) throws Exception {     HttpClient client = new HttpClient();     client.getParams().setParameter("parameterKey", "value");     HostConfiguration host = client.getHostConfiguration();     host.setHost(new URI("http://localhost:8080", true));... 16 Feb 12 » Connect Method Example For Proxy Client - import org.apache.commons.httpclient.ProxyClient; import org.apache.commons.httpclient.ConnectMethod; import org.apache.commons.httpclient.ProxyClient.ConnectResponse; import java.net.Socket; public class ConnectMethodExampleForProxyClient {   public static void main(String args[]) {     ProxyClient client = new ProxyClient();     client.getParams().setParameter("http.useragent","Proxy Test Client");     client.getHostConfiguration().setHost("www.somehost.com");     client.getHostConfiguration().setProxy("localproxyaddress",80);... 16 Feb 12 » Http post method Example - import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.methods.PostMethod; import java.io.BufferedReader; import java.io.InputStreamReader; public class PostMethodExample {   public static void main(String args[]) {     HttpClient client = new HttpClient();     client.getParams().setParameter("http.useragent", "Test Client");     BufferedReader br = null;... 16 Feb 12 » Get allowed http methods - import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.methods.OptionsMethod; import java.util.Enumeration; public class OptionsMethodExample {   public static void main(String args[]) {     HttpClient client = new HttpClient();     client.getParams().setParameter("http.useragent", "Test Client");     OptionsMethod method = new OptionsMethod("http://www.google.com");     try{... 16 Feb 12 » Http Client Simple Demo - import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.GetMethod; public class HttpClientTest {  public static void main(String args[]) throws Exception {       HttpClient client = new HttpClient();       GetMethod method = new GetMethod("http://www.google.com");       int returnCode = client.executeMethod(method);       System.err.println(method.getResponseBodyAsString());       method.releaseConnection();  }... 16 Feb 12 » Execute Http method (post/get) - import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HostConfiguration; import org.apache.commons.httpclient.methods.GetMethod; public class HttpClientPreferences {  public static void main(String args[]) throws Exception {       HttpClient client = new HttpClient();            System.err.println("The User Agent before changing it is: " + client.getParams().getParameter("http.useragent"));            client.getParams().setParameter("http.useragent","Browser at Client level");... 16 Feb 12