title: URL opens in browser but not in android program
body: <p>There is a URL which opens fine on PC and mobile browser (chrome), but when i try to open it in an android program using below code it gives following error.</p>
  
  <pre><code>private class DownloadWebPageTask extends AsyncTask&lt;String, Void, String&gt; {
  @Override
  protected String doInBackground(String... urls) {
    String response = "";
    for (String url : urls) {
      //DefaultHttpClient client = new DefaultHttpClient();
        HttpClient client = AndroidHttpClient.newInstance("Android");
      HttpGet httpGet = new HttpGet(url);
     // httpGet.setHeader("User-Agent", "Chrome");
      try {
        HttpResponse execute = client.execute(httpGet);
        InputStream content = execute.getEntity().getContent();
  
        BufferedReader buffer = new BufferedReader(new InputStreamReader(content));
        String s = "";
        while ((s = buffer.readLine()) != null) {
          response += s;
        }
  
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
    return response;
  }
  </code></pre>
  
  <p>on running the code I get an Access Denied error from the server. If I try any other url it works fine. I have tried searching on how to set user-agent to bypass any restrictions put on the server, but could not succeed. Please help.</p>
  
  <p>Additionally I have seen that the header section of the webpage from which this url is called (from browser) contains the below</p>
  
  <pre><code> &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
   &lt;meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /&gt;
   &lt;meta name="apple-mobile-web-app-capable" content="yes" /&gt;
   &lt;meta name="HandheldFriendly" content="true" /&gt;
   &lt;meta name="MobileOptimized" content="width" /&gt;
   &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  </code></pre>