title: Why is ResponseEntity body returning null?
body: <p>I am new to Java and creating APIs. I am trying to simply make a POST-request and get a specific value back. Here is my code:</p>
  
  <pre><code>@Service
  @AllArgsConstructor
  public class WebService {
  
      private RestTemplate restTemplate;
      private static final String PROJECT_URL = "http://localhost:8080/project";
  
      public ResponseEntity&lt;ProjectResponse&gt; createProject(Project project) {
          ResponseEntity&lt;ProjectResponse&gt; completeProject = restTemplate.postForEntity(PROJECT_URL, project, ProjectResponse.class);
          System.out.println("Response body " + completeProject.getBody());
          return completeProject;
      }
  
  }
  </code></pre>
  
  <p>And the ProjectResponse class simply has:</p>
  
  <pre><code>@Data
  @NoArgsConstructor
  public class ProjectResponse {
      private String id;
  }
  </code></pre>
  
  <p>The problem is that id aøwaus gets returned as (id=null). Even though when I use "String" instead of ProjectResponse everything works fine and I see that the id is created. So for some reason there is a problem with mapping the response to the ProjectResponse-class.</p>
  
  <p>Does anyone know what could be wrong? </p>