title: cURL equivalent in JAVA
body: <p>I am tasked with writing an authentication component for an open source <code>JAVA</code> app.  We have an in-house authentication widget that uses <code>https</code>.  I have some example <code>php</code> code that accesses the <code>widget</code> which uses <code>cURL</code> to handle the transfer.  </p>
  
  <p>My question is whether or not there is a port of <code>cURL</code> to <code>JAVA</code>, or better yet, what base package will get me close enough to handle the task? </p>
  
  <p><strong>Update</strong>:</p>
  
  <p>This is in a nutshell, the code I would like to replicate in JAVA:</p>
  
  <pre><code>$cp = curl_init();
  $my_url = "https://" . AUTH_SERVER . "/auth/authenticate.asp?pt1=$uname&amp;pt2=$pass&amp;pt4=full";
  curl_setopt($cp, CURLOPT_URL, $my_url);
  curl_setopt($cp, CURLOPT_RETURNTRANSFER, 1);
  $result = curl_exec($cp);
  curl_close($cp);
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/116650/curl-equivalent-in-java#116725">Heath</a>, I think you're on the right track, I think I'm going to end up using HttpsURLConnection and then picking out what I need from the response.</p>