title: getting 403 forbidden error
body: <p>Getting 403 forbidden for below code, though "<a href="https://jsonplaceholder.typicode.com/posts/1" rel="nofollow">https://jsonplaceholder.typicode.com/posts/1</a>" works in postman</p>
  
  <pre><code>@ComponentScan
  @EnableAutoConfiguration
  public class Application {
      public static void main(String[] args) {
  
          RestTemplate rt = new RestTemplate();
          HttpHeaders headers = new HttpHeaders();
          headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
          HttpEntity&lt;String&gt; entity = new HttpEntity&lt;String&gt;("parameters", headers);
          String url = "https://jsonplaceholder.typicode.com/posts/1";
          ResponseEntity&lt;String&gt; res = rt.exchange(url, HttpMethod.GET, entity, String.class);
  
          System.out.println(res);
      }
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>23:28:21.447 [main] DEBUG o.s.web.client.RestTemplate - Created GET request for "https://jsonplaceholder.typicode.com/posts/1"
  23:28:21.452 [main] DEBUG o.s.web.client.RestTemplate - Setting request Accept header to [text/plain, application/json, application/*+json, */*]
  23:28:21.452 [main] DEBUG o.s.web.client.RestTemplate - Writing [parameters] using [org.springframework.http.converter.StringHttpMessageConverter@3234e239]
  23:28:21.855 [main] WARN  o.s.web.client.RestTemplate - GET request for "https://jsonplaceholder.typicode.com/posts/1" resulted in 403 (Forbidden); invoking error handler
  Exception in thread "main" org.springframework.web.client.HttpClientErrorException: 403 Forbidden
      at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91)
      at org.springframework.web.client.RestTemplate.handleResponseError(RestTemplate.java:598)
      at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:556)
      at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:512)
      at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:454)
      at restFulWS.Application.main(Application.java:21)
  </code></pre>
  
  <p>Updated:
  Header snapshot from postman</p>
  
  <pre><code>Access-Control-Allow-Credentials →true
  CF-Cache-Status →HIT
  CF-RAY →2cfd2d4919e72dcd-BOM
  Cache-Control →public, max-age=14400
  Connection →keep-alive
  Content-Encoding →gzip
  Content-Type →application/json; charset=utf-8
  Date →Tue, 09 Aug 2016 18:12:32 GMT
  Etag →W/"134-PYMqYXMMQ68yDudiuhsVPg"
  Expires →Tue, 09 Aug 2016 22:12:32 GMT
  Pragma →no-cache
  Server →cloudflare-nginx
  Transfer-Encoding →chunked
  Vary →Accept-Encoding
  Via →1.1 vegur
  X-Content-Type-Options →nosniff
  X-Powered-By →Express
  </code></pre>
  
  <p>If someone can suggest, what i need to add in my code</p>