hasAnyOfMediaTypes method
Returns whether this context has any of the given media type, ignoring case and extra parameters.
Implementation note: Use MediaType to handle the comparison to avoid edge cases.
Implementation
bool hasAnyOfMediaTypes(List<String> mediaTypesList) {
Iterable<MediaType?> mediaTypes = mediaTypesList.map(MediaType.parse);
return mediaTypes
.whereNotNull()
.any((mediaType) => this.mediaTypes.any(mediaType.contains));
}