title: HttpClient is not working with localhost
body: <p>I developed a web service in java Jersey REST. I used HttpClient to call a a basic GET method. </p>
  
  <p>When using this URL <code>http://localhost:8080/myserver/rest/location</code> on browser, it works.</p>
  
  <p>When using this code to call the GET method, I get a 404 Not Found error.</p>
  
  <pre><code>private static final String BASIC_URL = "http://localhost:8080/myserver/rest/location";
  
  public static boolean isAlive() throws URISyntaxException, ClientProtocolException, IOException{
      HttpClient httpclient = new DefaultHttpClient();
      HttpGet get=new HttpGet(BASIC_URL);
      System.out.println(get.getURI());
  
        System.out.println("after adding all namevalues: "+get.getURI());
        HttpResponse response = httpclient.execute(get);
      StatusLine statusLine = response.getStatusLine();
  
      if (statusLine.getStatusCode() != 200) {
          System.out.println("response status="+statusLine.getStatusCode());
          return false;
      }
      System.out.println("Response sent succesfully with status "+200);
      return true;
  }
  </code></pre>
  
  <p>Any clue?</p>
  
  <p>UPDATE</p>
  
  <p>Also, I tried <code>http://192.168.9.160:8080/LocationRetreiverServer/rest/location</code> (my local IP) and it gave Not Found error !!</p>