title: Differences between a HttpURLConnection and a browser connection
body: <p>I'm trying to connect to a web page through a HttpURLConnection but it's not responding the same as a regular browser (firefox, chrome). I'm getting an error 500.</p>
  
  <p>With the same code I can get "anyother" page (google, for example). My code is posted below, but I'm pretty sure it is ok. </p>
  
  <p>Using "Live HTTP Headers" firefox addon I sent the same request and received a valid response.</p>
  
  <pre><code>//...
  String urlConsulta = "myURL";
  URL url = new URL(urlConsulta);
  HttpURLConnection uConsulta = (HttpURLConnection)consulta.openConnection();
  uConsulta.setDoOutput(true);
  uConsulta.setRequestMethod("POST");
  uConsulta.addRequestProperty("Content-Type", "application/x-www-form-urlencoded");
  uConsulta.addRequestProperty("Host", "host");
  //...
  </code></pre>