-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Return 415 for form data via @RequestBody in WebFlux #26386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Technically it is possible to read the body via |
A
@RestController
likeis expected to handle requests with content type application/json. When the client request has a content type x-www-form-urlencoded, I would expect that the server returns 415 Unsupported Media Type or another client error.
Instead Spring throws java.lang.IllegalStateException: In a WebFlux application, form data is accessed via ServerWebExchange.getFormData().
A sample application with failing test can be found here: https://github.com/huberchrigu/spring-reactive-wrong-content-type
The text was updated successfully, but these errors were encountered: