title: Why this Spring Boot app throws exception for the post request
body: <p>Controller:-   </p>
  
  <pre><code>@RestController
  public class MyController {
  
  private String url = "https://scoreboard-backend-dev.herokuapp.com/scoreBoard";
  
  @Autowired
  private RestTemplate restTemplate;
  
  @Bean
  public RestTemplate restTemplate(RestTemplateBuilder builder) {
      return builder.build();
  }
  
  @PostMapping("/add/score")
  public ScoreBoard addScore(@RequestBody ScoreBoard scoreBoard){
      ResponseEntity&lt;ScoreBoard&gt; responseEntity =  restTemplate
                         .postForEntity(url+"/add/score", scoreBoard, ScoreBoard.class );
      return responseEntity.getBody();
  
  }
  </code></pre>
  
  <p>Model:-</p>
  
  <pre><code>public class ScoreBoard {
  
      private long id;
      private String team;
      private int point;
  
      public ScoreBoard(){
  
      }
  
      public long getId() {
          return id;
      }
  
      public void setId(long id) {
          this.id = id;
      }
  
      public String getTeam() {
          return team;
      }
  
      public void setTeam(String team) {
          this.team = team;
      }
  
      public int getPoint() {
          return point;
      }
  
      public void setPoint(int point) {
          this.point = point;
      }
  }
  </code></pre>
  
  <p>I tried to test it by Postman with the following body:-
  <a href="http://localhost:8080/add/score" rel="nofollow noreferrer">http://localhost:8080/add/score</a> (POST)</p>
  
  <pre><code>{
      "id": 1,
      "team": "new team",
      "point": 3030
  }
  </code></pre>
  
  <p>I got the following error:</p>
  
  <pre><code>2020-06-10 21:19:17.303 ERROR 19926 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.RestClientException: Error while extracting response for type [class com.example.resttemplatedemo.model.ScoreBoard] and content type [application/json]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unrecognized token 'ScoreBoard': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'ScoreBoard': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
   at [Source: (PushbackInputStream); line: 1, column: 12]] with root cause
  
  com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'ScoreBoard': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
   at [Source: (PushbackInputStream); line: 1, column: 12]
      at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1851) ~[jackson-core-2.11.0.jar:2.11.0]
  </code></pre>