title: HttpGet on localhost connect failed
body: <p>I am trying to build a android application that gets data from a REST service as JSON.</p>
  
  <p>I am using a PC , windows, eclipse and a android emulator.</p>
  
  <p>In this function here below. If I use a URL that is live on the internet then it works perfectly.</p>
  
  <pre><code>HttpGet httpGet = new HttpGet("http://www.cheesejedi.com/rest_services/get_big_cheese.php?puzzle=1");
  </code></pre>
  
  <p>but if I use a url that is hosted locally ( using visual studio ) on my own pc I get  a error saying <strong>"Conection refused."</strong> </p>
  
  <p>HttpGet httpGet = new HttpGet("http://" + "localhost:50851/Default.aspx");</p>
  
  <p>How do I connect to my local host?  Thnaks</p>
  
  <hr>
  
  <pre><code>protected String doInBackground(Void... params) {
               HttpClient httpClient = new DefaultHttpClient();
               HttpContext localContext = new BasicHttpContext();
               //HttpGet httpGet = new HttpGet("http://www.cheesejedi.com/rest_services/get_big_cheese.php?puzzle=1");
              HttpGet httpGet = new HttpGet("http://" + "localhost:50851/Default.aspx");
               //
               String text = null;
               try {
                     HttpResponse response = httpClient.execute(httpGet, localContext);
                     HttpEntity entity = response.getEntity();
                     text = getASCIIContentFromEntity(entity);
               } catch (Exception e) {
                   return e.getLocalizedMessage();
               }
               return text;
          }
  </code></pre>