title: Sending a post request to localhost
body: <p>I need to send a http post request from my android device to a web server that is running on my localhost:8080 and is being hosted by the google app engine.</p>
  
  <p>the current code is this:</p>
  
  <pre><code>    try {
  
                  HttpPost httppost = new HttpPost("http://192.168.2.220:8080");
                  httppost.setHeader("Content-type", "application/json");
                  ResponseHandler &lt;String&gt; responseHandler = new BasicResponseHandler();
                  StringEntity se = new StringEntity(object.toString()); 
             se.setContentEncoding(newBasicHeader(HTTP.CONTENT_TYPE,"application/json"));
                  httppost.setEntity(se);
                  System.out.println("Request Sent");
                  String response = httpclient.execute(httppost, responseHandler);
  
                  String temp = EntityUtils.toString(response.getEntity());
  
  
  
              } catch (ClientProtocolException e) {}
              catch (IOException e) {
              }
          }
  </code></pre>
  
  <p>I also tried setting:</p>
  
  <pre><code>    HttpPost httppost = new HttpPost("http://10.0.2.2:8080");
  </code></pre>
  
  <p>In all cases, the response is null and the program force closes. am i sending the request correctly? can anyone please guide me here?</p>
  
  <p>Thanks</p>