title: HttpUrlConnection Post to Laravel - java.io.filenotfoundexception
body: <p>I am trying to post to a Laravel using HttpUrlConnection. But as the title suggest, it is throwing exception.</p>
  
  <p>Kindly check my code and let me know, where i am wrong.</p>
  
  <pre><code> public String HttpUrlPost()
      {
          BufferedWriter writer;
          BufferedReader reader;
          StringBuilder sb= new StringBuilder();
          String data;
  
          try
          {
              URL url = new URL("http://192.168.0.104/laravel5/public/login");
              Log.d(TAG,"URL is : " + url.toString());
  
              data = URLEncoder.encode("username",HTTP.UTF_8) + "=" + URLEncoder.encode("me",HTTP.UTF_8);
              data += "&amp;"  + URLEncoder.encode("password",HTTP.UTF_8) + "=" + URLEncoder.encode("admin",HTTP.UTF_8);
              Log.d(TAG,"data is : " + data);
  
              HttpURLConnection connection = (HttpURLConnection) url.openConnection();
              connection.setDoOutput(true);
              connection.setRequestMethod("POST");
              connection.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
  
              OutputStream os = connection.getOutputStream();
              writer = new BufferedWriter(new OutputStreamWriter(os, HTTP.UTF_8));
              writer.write(data);
              writer.flush();
  
              reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
              String line;
              while ((line = reader.readLine()) != null)
              {
                  sb.append(line);
              }
  
              writer.close();
              reader.close();
          }
          catch(IOException e)
          {
              e.printStackTrace();
          }
  
          return sb.toString();
      }
  </code></pre>
  
  <p>Laravel side is very simple. I just want to check if post returns anything.</p>
  
  <pre><code>Route::post('login',function(){
  
  $users = array('username' =&gt; 'a', 'password'=&gt;'d');
  return $users;});
  </code></pre>
  
  <p>Please note that I am able to use Get method easily with laravel (it returns Json).</p>