title: Android URL connection java.io.FileNotFoundException
body: <p>I try to send a normal Http Request to a WordlPress Website.</p>
  
  <p>This is the URL:
  "<a href="http://localhost.com/api/submit_comment/?post_id=12345&amp;name=Max&amp;email=Max.Mustermann@googlemail.com&amp;content=hallo" rel="nofollow">http://localhost.com/api/submit_comment/?post_id=12345&amp;name=Max&amp;email=Max.Mustermann@googlemail.com&amp;content=hallo</a>"</p>
  
  <p>If I open this with my Web-Browser all works fine. If I open it over this over an Android App it throws a java.io.FileNotFoundException.</p>
  
  <p>The Android Code:</p>
  
  <pre><code>class SendComment extends AsyncTask&lt;String, Void, String&gt; {
  
      protected String doInBackground(String... urls) {
          String _output = null;
          try {
              URL url = new URL(urls[0]);
              BufferedReader buffer = new BufferedReader(new InputStreamReader(url.openStream()));
              _output = buffer.readLine();
              buffer.close();
          } catch (IOException e) {
              e.printStackTrace();
          }
          return _output;
      }
  
      protected void onPostExecute(String result) {
  
      }
  }
  </code></pre>
  
  <p>But when I remove the "@" or the ".com" of the E-Mail address it even works on Android. It seems like a available E-Mail address is the reason for the crash.</p>
  
  <p>This is the StackTrace:</p>
  
  <pre><code>java.io.FileNotFoundException: http://localhost.com/api/submit_comment?post_id=23856&amp;name=Max&amp;email=Max.Mustermann%40googlemail.com&amp;content=hallo 
  at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:206) 
  at java.net.URL.openStream(URL.java:470)
  at de.example.app.SendComment.doInBackground(ServerManager.java:230)
  at de.example.app.SendComment.doInBackground(ServerManager.java:1)
  at android.os.AsyncTask$2.call(AsyncTask.java:292)
  at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
  at java.lang.Thread.run(Thread.java:818)
  </code></pre>