0 votes
90 views
asked in JAVA by
HI  

  Why we need the @requestbody in jave webservice and also provide the template code?

1 Answer

0 votes
answered by (8.2k points)

Hi  

    The @RequestBody method parameter annotation should bind the json value in the HTTP request body to the java object by using a HttpMessageConverter

@RequestMapping(value = "/", method = RequestMethod.POST)
public ResponseEntity<Car> update(@RequestBody Car car) {
    ...
}

Categories

...