title: HttpClient 3.1 - Enable JavaScript to view the page content
body: <p>I have been trying to get a page content using HTTPClient 3.1 and after executing the get method, I'm getting "Please enable JavaScript to view the page content" in return content.</p>
  
  <pre><code>import org.apache.commons.httpclient.HttpClient;
  import org.apache.commons.httpclient.methods.GetMethod;
  
  public class FormsAndSupplyNextAgent
  {
  HttpClient httpClient = null;
  GetMethod getMethod = null;
  String contents, reDirURL, secondLevelLink, cri,requestVerToken;
  int httpStatus;
  
  public String getPageContent()
  {
      getMethod = new GetMethod("http://someurl.com");
      httpClient.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
      httpStatus = httpClient.executeMethod(getMethod);//200
      contents = getMethod.getResponseBodyAsString();//JavaScript error
      getMethod.releaseConnection();
  }
  }
  </code></pre>
  
  <p>Few Things I have tried below:</p>
  
  <p>--> I have tried changing the CookiePolicy to DEFAULT, IGNORE_COOKIES, and other available options but still no luck.
  --> Hard coded the cookie/used Cookie class/Header class to set cookie</p>
  
  <p>Could you please let me what other things I can try to get the proper content. Any suggestion will be helpful.</p>