When the @RequestBody
is added, Spring would require the content type to be application/json
and the JSON body is required.
When the @RequestPart
is added, Spring would require the content type to be multipart/form-data
and input as form
=> If both of them are included in a controller, the error 403 will be thrown because the content type is not correct.
In this case, I think we can input username
and email
as @RequestPart
@RequestPart("username") String username