Skip to content

Simplify MediaTypeRequestMatcher construction #6612

@jzheaux

Description

@jzheaux

MediaTypeServerWebExchangeMatcher is very easy to use because it simply takes a list of MediaTypes in its constructor:

public MediaTypeServerWebExchangeMatcher(MediaType... mediaTypes) {
    // ...
}

However, MediaTypeRequestMatcher, the servlet equivalent, requires the user to supply a ContentNegotiationStrategy as well:

public MediaTypeRequestMatcher(ContentNegotiationStrategy contentNegotiationStrategy,
    MediaType... mediaTypes) {
    // ...
}

It would be nice if MediaTypeRequestMatcher were as easy to use as MediaTypeServerWebExchangeMatcher.

Metadata

Metadata

Assignees

Labels

in: webAn issue in web modules (web, webmvc)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions