Single field body in Spring Rest request

Viewed 5996

in Spring, is it possible to eg. POST single object to controller with @RequestBody? Something like this:

@RequestMapping(value = "/users", method = RequestMethod.POST)
public ResponseEntity<Void> createUser(@RequestBody Long userId) {
    // do smth with userId
}

If yes, what should json body look like?

2 Answers
Related