title: Android BufferedInputStream HTTP POST/GET
body: <p>I Use BufferedInputStream For HTTP POST/GET</p>
  
  <p>But I Get Some Error the Below</p>
  
  <ol>
  <li>java.io.FileNotFoundException: <a href="http://XX.XX.XX.XX/WebWS/data.aspx" rel="nofollow">http://XX.XX.XX.XX/WebWS/data.aspx</a></li>
  <li>Transport endpoint is not connected</li>
  </ol>
  
  <p>Why Get This Error. My Code is Below</p>
  
  <pre><code>URL url = new URL(glob.postUrl);
  
      HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
  
      try {
  
          httpConn.setDoInput(true);
          httpConn.setDoOutput(true);
          httpConn.setRequestMethod("GET");
          httpConn.setRequestProperty("Content-Type",
                  "application/x-www-form-urlencoded");
          httpConn.setRequestProperty("Content-Language", "TR");      
          httpConn.setConnectTimeout(12000);
  
  
          Iterator&lt;String&gt; reqProps = hMap.keySet().iterator();
          while (reqProps.hasNext()) {
              String key = reqProps.next();
              String value = hMap.get(key);
              httpConn.addRequestProperty(key, value);
          }
  
          InputStream in = new BufferedInputStream(httpConn.getInputStream());
  
          StringBuilder builder = new StringBuilder();
          String line;
          try {
              BufferedReader reader = new BufferedReader(
                      new InputStreamReader(in, "UTF-8"));
              while ((line = reader.readLine()) != null) {
                  builder.append(line);
              }
          } finally {
              in.close();
          }
          httpConn.disconnect();
  </code></pre>
  
  <p>Thanks.</p>