Skip to content

Introduce request parameter based content negotiation for ResponseBody / HttpMessageConverter approach [SPR-7517] #12175

@spring-projects-issues

Description

@spring-projects-issues

Neil Laurance opened SPR-7517 and commented

My client application may not support setting the HTTP Accept header.

When using views, I can configure a ContentNegotiatingViewResolver to ignore the accept header, and use a request parameter instead.

But if I want to use a ResponseBody / HttpMessageConverter approach, this only supports the HTTP Accept header.

From AnnotationMethodHandlerAdapter$ServletHandlerMethodInvoker#writeWithMessageConverters:

List<MediaType> acceptedMediaTypes = inputMessage.getHeaders().getAccept();

Affects: 3.0 M1, 3.0 M2, 3.0 M3, 3.0 M4, 3.0 RC1, 3.0 RC2, 3.0 RC3, 3.0 GA, 3.0.1, 3.0.2, 3.0.3, 3.0.4

Issue Links:

1 votes, 2 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions