title: Consuming rest works with curl but does not work when I am usiing RestTemplate
body: <p>I have an issue with <code>RestTemplate</code>, I want to consume  <a href="https://swapi.co/api/" rel="nofollow noreferrer">https://swapi.co/api/</a></p>
  
  <p>It works when I am using Curl:</p>
  
  <p><code>curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET</code></p>
  
  <p>But when I am trying to use <code>RestTemplate</code> it doesn't work.</p>
  
  <pre><code>    RestTemplate restTemplate = new RestTemplate();
      HttpHeaders headers = new HttpHeaders();
      headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
      headers.setContentType(MediaType.APPLICATION_JSON);
      HttpEntity&lt;?&gt; entity = new HttpEntity&lt;&gt;(headers);
  
  
      HttpEntity&lt;String&gt; response = restTemplate.exchange("http://swapi.co/api/", HttpMethod.GET, entity, String.class);
  
      Root root = new Gson().fromJson(response.getBody(), Root.class);
      System.out.println(root);
  </code></pre>
  
  <p>As you can see I set Accept and ContentType like in curl command. What am I doing wrong, all time I am receiving 403 Forbidden Status? 
  I am using spring boot with spring security, but I disable csrf mode.</p>