title: java.io.IOException: Server returned HTTP response code: 403 for URL
body: <p>My code goes like this:</p>
  
  <pre><code>URL url;
  URLConnection uc;
  StringBuilder parsedContentFromUrl = new StringBuilder();
  String urlString="http://www.example.com/content/w2e4dhy3kxya1v0d/";
  System.out.println("Getting content for URl : " + urlString);
  url = new URL(urlString);
  uc = url.openConnection();
  uc.connect();
  uc.getInputStream();
  BufferedInputStream in = new BufferedInputStream(uc.getInputStream());
  int ch;
  while ((ch = in.read()) != -1) {
      parsedContentFromUrl.append((char) ch);
  }
  System.out.println(parsedContentFromUrl);
  </code></pre>
  
  <p>However when I am trying to access the URL through browser there is no problem , but when I try to access it through a java program, it throws expection:</p>
  
  <pre><code>java.io.IOException: Server returned HTTP response code: 403 for URL
  </code></pre>
  
  <p>What is the solution?</p>