title: httpclient api for java project
body: <p>Where can i find and download the api to implement that piece of code? I searched it with google but i can't find it. The only one i found is this: <a href="http://hc.apache.org/downloads.cgi" rel="nofollow">http://hc.apache.org/downloads.cgi</a>  but it's not that. Thank you.</p>
  
  <pre><code>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("j_username", "abc");  
      client.getParams().setParameter("j_password", "pqr");  
  
      GetMethod method = new GetMethod("http://localhost:8080/");  
      try{  
        client.executeMethod(method);  
        Cookie[] cookies = client.getState().getCookies();  
        for (int i = 0; i &lt; cookies.length; i++) {  
          Cookie cookie = cookies[i];  
          System.err.println(  
            "Cookie: " + cookie.getName() +  
            ", Value: " + cookie.getValue() +  
            ", IsPersistent?: " + cookie.isPersistent() +  
            ", Expiry Date: " + cookie.getExpiryDate() +  
            ", Comment: " + cookie.getComment());  
          }  
        client.executeMethod(method);  
      } catch(Exception e) {  
        System.err.println(e);  
      } finally {  
        method.releaseConnection();  
      }  
    }  
  }  
  </code></pre>