title: Android how to make GET or POST Http Request using url with an IP address instead of HostName
body: <p>Hi all I am trying to send data to my development database from android application using Post but am getting exception</p>
  
  <pre><code>09-18 15:23:36.801: W/System.err(6755): java.io.FileNotFoundException: http://10.255.162.84:8080/web/events
  09-18 15:23:36.801: W/System.err(6755):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162)
  </code></pre>
  
  <p>If I copy paste the url the web browser in my computer. the webpage I am trying to get works.
  If I replace the url with <code>https:www.google.com</code> in my application, it works.
  What does this mean? I can't connect make http connection without a host name?</p>
  
  <p>code</p>
  
  <pre><code>URL url = new URL("http://10.255.162.84:8080/web/events");
                  HttpURLConnection conn = (HttpURLConnection)url.openConnection();
                  conn.setReadTimeout(20000 /*millis*/);
                  conn.setConnectTimeout(15000 /*millis*/);
                  conn.setRequestMethod("GET");
                  conn.setDoInput(true);
                  conn.setDoOutput(true);
                  conn.connect();
  
                  System.out.println(conn.getResponseCode());
                  InputStream is = conn.getInputStream();
                  Reader reader = new InputStreamReader(is, "UTF-8");
                  char[] buffer = new char[500];
                  reader.read(buffer);
                  System.out.println(new String(buffer));
  </code></pre>
  
  <p>Additional information</p>
  
  <p>The server to receive get and post requests is running on my PC port 8080 via a broadband connection. 
  I am running the application on my low end phone running android 2.2 (Froyo)
  I hope that's all the relevant information but am glad to provide more. I know you get this all the time but <strong>I swear to you I am really new to android</strong></p>