title: Is there an equivalent to the Apache HTTP Client in JavaScript?
body: <p>I am a new programmer whose primary background is in Java.  I am attempting to write in fault handling to a program in Javascript as I would in Java.  In java I use the Apache HTTP client to both create the client and call the Httpget request.  </p>
  
  <pre><code> HttpClient cli = new DefaultHttpClient();
   cli.getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000);
   HttpResponse resp = null;
   for (int i = 0 ; i &lt; 5 ; i++) {
   try {
   resp = cli.execute(new HttpGet("http://example.org/products"));
   }
   catch{//code}
   }
  </code></pre>
  
  <p>I am unsure how to emulate this behavior in a javascript environment.  Does anyone have insight or knowledge into this field?</p>