Skip to content

Misleading error message in HandlerMethodInvoker.resolveRequestBody() [SPR-5767] #10437

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

Closed
spring-projects-issues opened this issue May 18, 2009 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Kenny MacLeod opened SPR-5767 and commented

Line 450 of HandlerMethodInvoker.resolveRequestBody throws the exception "Cannot extract response" when it fails to find a content type in the inbound request.

As well as the message itself being confusing, is the check itself really necessary? If there are HttpMessageConverters present that do not care about the content type, should the framework be enforcing it?


Affects: 3.0 M3

Referenced from: commits d7d1ae8

1 votes, 1 watchers

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

I fixed the error message, but the Content-Type is still required for @RequestBody annotations.

For scenarios where a Content-Type is not available, a WebArgumentResolver might be more applicable.

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 M4 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants