title: HttpURLConnection returns 503 error even though it's working fine with browser
body: <p>When I have written following piece of code to check whether the site is up or not I always get http 503, even though the site is working fine when I hit it on browser.</p>
  
  <pre><code>URL url=getASCIIUrl(httpUrl);
  HttpURLConnection con = null;
      con = (HttpURLConnection) url.openConnection();
                  HttpURLConnection.setFollowRedirects(false);
                  con.setRequestMethod("GET");
                  con.setConnectTimeout(CONNECTION_TIMEOUT);
                  con.addRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.01; WiPOSTndows NT 5.0)");
                  int code = con.getResponseCode();
  </code></pre>
  
  <p>Everytime I get Http 503 in responsecode. Can anyone suggest a way to overcome this problem?</p>