Uses of Class
org.springframework.http.MediaType
Packages that use MediaType
Package
Description
Contains a basic abstraction over client/server-side HTTP.
Contains an abstraction over client-side HTTP.
JSON encoder and decoder support.
Multipart support.
Provides an encoder and a decoder for
Google Protocol Buffers.
Provides an HttpMessageConverter abstraction to convert between Java objects and HTTP input/output messages.
Provides HttpMessageConverter implementations for handling Atom and RSS feeds.
Provides HttpMessageConverter implementations for handling JSON.
Provides an HttpMessageConverter implementation for handling
Google Protocol Buffers.
Provides HttpMessageConverter implementations for handling XML.
Mock implementations of reactive HTTP server contracts.
A comprehensive set of Servlet API 4.0 mock objects, targeted at usage with
Spring's Web MVC framework.
Contains built-in
RequestMatcher
implementations.Contains built-in
ResponseCreator
implementations.Support for testing Spring WebFlux server endpoints via
WebTestClient.Contains built-in
RequestBuilder
implementations.Contains built-in
ResultMatcher and ResultHandler implementations.Common, generic interfaces that define minimal boundary points
between Spring's web infrastructure and other framework modules.
This package contains classes used to determine the requested the media types in a request.
Core package of the client-side web support.
RequestedContentTypeResolver
strategy and implementations to resolve the requested content type for a
given request.Spring WebFlux configuration infrastructure.
Provides a foundation for both the reactive client and server subpackages.
Provides a reactive
WebClient
that builds on top of the
org.springframework.http.client.reactive reactive HTTP adapter layer.Classes supporting the
org.springframework.web.reactive.function.client package.Provides the types that make up Spring's functional web framework for Reactive environments.
Classes supporting the
org.springframework.web.reactive.function.server package.Support classes for serving static resources.
Support for various programming model styles including the invocation of
different types of handlers, e.g.
RequestCondition
and implementations for matching requests based on different criteria.Support for result handling through view resolution.
Support classes for the integration of
FreeMarker
as Spring web view technology.
Support classes for views based on the JSR-223 script engine abstraction
(as included in Java 6+), e.g.
Core interfaces and classes for Spring's generic, reactive web support.
Annotation-based setup for Spring MVC.
Provides the types that make up Spring's functional web framework for Servlet environments.
Common MVC logic for matching incoming requests based on conditions.
MVC infrastructure for annotation-based handler method processing, building on the
org.springframework.web.method.annotation package.Support classes for serving static resources.
Provides standard View and ViewResolver implementations,
including abstract base classes for custom implementations.
TransportHandler
implementation classes as well as a concrete
SockJsService.-
Uses of MediaType in org.springframework.http
Fields in org.springframework.http declared as MediaTypeModifier and TypeFieldDescriptionstatic final MediaTypeMediaType.ALLPublic constant media type that includes all media ranges (i.e.static final MediaTypeMediaType.APPLICATION_ATOM_XMLPublic constant media type forapplication/atom+xml.static final MediaTypeMediaType.APPLICATION_CBORPublic constant media type forapplication/cbor.static final MediaTypeMediaType.APPLICATION_FORM_URLENCODEDPublic constant media type forapplication/x-www-form-urlencoded.static final MediaTypeMediaType.APPLICATION_JSONPublic constant media type forapplication/json.static final MediaTypeMediaType.APPLICATION_JSON_UTF8Deprecated.static final MediaTypeMediaType.APPLICATION_NDJSONPublic constant media type forapplication/x-ndjson.static final MediaTypeMediaType.APPLICATION_OCTET_STREAMPublic constant media type forapplication/octet-stream.static final MediaTypeMediaType.APPLICATION_PDFPublic constant media type forapplication/pdf.static final MediaTypeMediaType.APPLICATION_PROBLEM_JSONPublic constant media type forapplication/problem+json.static final MediaTypeMediaType.APPLICATION_PROBLEM_JSON_UTF8Deprecated.as of 5.2 in favor ofAPPLICATION_PROBLEM_JSONsince major browsers like Chrome now comply with the specification and interpret correctly UTF-8 special characters without requiring acharset=UTF-8parameter.static final MediaTypeMediaType.APPLICATION_PROBLEM_XMLPublic constant media type forapplication/problem+xml.static final MediaTypeMediaType.APPLICATION_RSS_XMLPublic constant media type forapplication/rss+xml.static final MediaTypeMediaType.APPLICATION_STREAM_JSONDeprecated.as of 5.3, see notice onAPPLICATION_STREAM_JSON_VALUE.static final MediaTypeMediaType.APPLICATION_XHTML_XMLPublic constant media type forapplication/xhtml+xml.static final MediaTypeMediaType.APPLICATION_XMLPublic constant media type forapplication/xml.static final MediaTypeMediaType.IMAGE_GIFPublic constant media type forimage/gif.static final MediaTypeMediaType.IMAGE_JPEGPublic constant media type forimage/jpeg.static final MediaTypeMediaType.IMAGE_PNGPublic constant media type forimage/png.static final MediaTypeMediaType.MULTIPART_FORM_DATAPublic constant media type formultipart/form-data.static final MediaTypeMediaType.MULTIPART_MIXEDPublic constant media type formultipart/mixed.static final MediaTypeMediaType.MULTIPART_RELATEDPublic constant media type formultipart/related.static final MediaTypeMediaType.TEXT_EVENT_STREAMPublic constant media type fortext/event-stream.static final MediaTypeMediaType.TEXT_HTMLPublic constant media type fortext/html.static final MediaTypeMediaType.TEXT_MARKDOWNPublic constant media type fortext/markdown.static final MediaTypeMediaType.TEXT_PLAINPublic constant media type fortext/plain.static final MediaTypeMediaType.TEXT_XMLPublic constant media type fortext/xml.Fields in org.springframework.http with type parameters of type MediaTypeModifier and TypeFieldDescriptionstatic final Comparator<MediaType>MediaType.QUALITY_VALUE_COMPARATORDeprecated.As of 6.0, with no direct replacementstatic final Comparator<MediaType>MediaType.SPECIFICITY_COMPARATORDeprecated.As of 6.0, with no direct replacementMethods in org.springframework.http that return MediaTypeModifier and TypeMethodDescriptionstatic MediaTypeMediaType.asMediaType(MimeType mimeType) Re-create the given mime type as a media type.MediaType.copyQualityValue(MediaType mediaType) Return a replica of this instance with the quality value of the givenMediaType.HttpHeaders.getContentType()Return the media type of the body, as specified by theContent-Typeheader.static MediaTypeMediaType.parseMediaType(String mediaType) Parse the given String into a singleMediaType.MediaType.removeQualityValue()Return a replica of this instance with its quality value removed.static MediaTypeParse the given String value into aMediaTypeobject, with this method name following the 'valueOf' naming convention (as supported byConversionService.Methods in org.springframework.http that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionMediaType.asMediaTypes(List<MimeType> mimeTypes) Re-create the given mime types as media types.HttpHeaders.getAccept()Return the list of acceptable media types, as specified by theAcceptheader.HttpHeaders.getAcceptPatch()Return the list of acceptable media types forPATCHmethods, as specified by theAccept-Patchheader.MediaTypeFactory.getMediaType(String filename) Determine a media type for the given file name, if possible.MediaTypeFactory.getMediaType(Resource resource) Determine a media type for the given resource, if possible.MediaTypeFactory.getMediaTypes(String filename) Determine the media types for the given file name, if possible.MediaType.parseMediaTypes(String mediaTypes) Parse the comma-separated string into a list ofMediaTypeobjects.MediaType.parseMediaTypes(List<String> mediaTypes) Parse the given list of (potentially) comma-separated strings into a list ofMediaTypeobjects.Methods in org.springframework.http with parameters of type MediaTypeModifier and TypeMethodDescriptionSet the list of acceptable media types, as specified by theAcceptheader.RequestEntity.BodyBuilder.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader.ResponseEntity.BodyBuilder.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader.MediaType.copyQualityValue(MediaType mediaType) Return a replica of this instance with the quality value of the givenMediaType.booleanIndicate whether thisMediaTypeincludes the given media type.booleanMediaType.isCompatibleWith(MediaType other) Indicate whether thisMediaTypeis compatible with the given media type.voidHttpHeaders.setContentType(MediaType mediaType) Set the media type of the body, as specified by theContent-Typeheader.Method parameters in org.springframework.http with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidSet the list of acceptable media types, as specified by theAcceptheader.voidHttpHeaders.setAcceptPatch(List<MediaType> mediaTypes) static voidMediaType.sortByQualityValue(List<MediaType> mediaTypes) Deprecated.As of 6.0, with no direct replacementstatic voidMediaType.sortBySpecificity(List<MediaType> mediaTypes) Deprecated.As of 6.0, in favor ofMimeTypeUtils.sortBySpecificity(List)static voidMediaType.sortBySpecificityAndQuality(List<MediaType> mediaTypes) Deprecated.As of 6.0, in favor ofMimeTypeUtils.sortBySpecificity(List)static StringMediaType.toString(Collection<MediaType> mediaTypes) Return a string representation of the given list ofMediaTypeobjects.Constructors in org.springframework.http with parameters of type MediaTypeModifierConstructorDescriptionCopy-constructor that copies the type, subtype and parameters of the givenMediaType, and allows to set the specified character set.Copy-constructor that copies the type and subtype of the givenMediaType, and allows for different parameters. -
Uses of MediaType in org.springframework.http.client
Methods in org.springframework.http.client with parameters of type MediaTypeModifier and TypeMethodDescriptionMultipartBodyBuilder.PartBuilder.contentType(MediaType contentType) Set the media type of the part.Variant ofMultipartBodyBuilder.part(String, Object)that also accepts a MediaType. -
Uses of MediaType in org.springframework.http.codec
Methods in org.springframework.http.codec that return MediaTypeModifier and TypeMethodDescriptionprotected MediaTypeDecoderHttpMessageReader.getContentType(HttpMessage inputMessage) Determine the Content-Type of the HTTP message based on the "Content-Type" header or otherwise default toAPPLICATION_OCTET_STREAM.protected MediaTypeFormHttpMessageWriter.getMediaType(MediaType mediaType) Methods in org.springframework.http.codec that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionDecoderHttpMessageReader.getReadableMediaTypes()DecoderHttpMessageReader.getReadableMediaTypes(ResolvableType elementType) FormHttpMessageReader.getReadableMediaTypes()HttpMessageReader.getReadableMediaTypes()Return the list of media types supported by this reader.HttpMessageReader.getReadableMediaTypes(ResolvableType elementType) Return the list of media types supported by this Reader for the given type of element.ServerSentEventHttpMessageReader.getReadableMediaTypes()HttpMessageEncoder.getStreamingMediaTypes()Return "streaming" media types for which flushing should be performed automatically vs at the end of the input stream.EncoderHttpMessageWriter.getWritableMediaTypes()EncoderHttpMessageWriter.getWritableMediaTypes(ResolvableType elementType) FormHttpMessageWriter.getWritableMediaTypes()HttpMessageWriter.getWritableMediaTypes()Return the list of media types supported by this Writer.HttpMessageWriter.getWritableMediaTypes(ResolvableType elementType) Return the list of media types supported by this Writer for the given type of element.ResourceHttpMessageWriter.getWritableMediaTypes()ServerSentEventHttpMessageWriter.getWritableMediaTypes()Methods in org.springframework.http.codec with parameters of type MediaTypeModifier and TypeMethodDescriptionbooleanDecoderHttpMessageReader.canRead(ResolvableType elementType, MediaType mediaType) booleanFormHttpMessageReader.canRead(ResolvableType elementType, MediaType mediaType) booleanHttpMessageReader.canRead(ResolvableType elementType, MediaType mediaType) Whether the given object type is supported by this reader.booleanServerSentEventHttpMessageReader.canRead(ResolvableType elementType, MediaType mediaType) booleanEncoderHttpMessageWriter.canWrite(ResolvableType elementType, MediaType mediaType) booleanFormHttpMessageWriter.canWrite(ResolvableType elementType, MediaType mediaType) booleanHttpMessageWriter.canWrite(ResolvableType elementType, MediaType mediaType) Whether the given object type is supported by this writer.booleanResourceHttpMessageWriter.canWrite(ResolvableType elementType, MediaType mediaType) booleanServerSentEventHttpMessageWriter.canWrite(ResolvableType elementType, MediaType mediaType) HttpMessageEncoder.getEncodeHints(ResolvableType actualType, ResolvableType elementType, MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response) Get decoding hints based on the server request or annotations on the target controller method parameter.protected MediaTypeFormHttpMessageWriter.getMediaType(MediaType mediaType) EncoderHttpMessageWriter.getWriteHints(ResolvableType streamType, ResolvableType elementType, MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response) Get additional hints for encoding for example based on the server request or annotations from controller method parameters.reactor.core.publisher.Mono<Void>EncoderHttpMessageWriter.write(Publisher<? extends T> inputStream, ResolvableType actualType, ResolvableType elementType, MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response, Map<String, Object> hints) reactor.core.publisher.Mono<Void>EncoderHttpMessageWriter.write(Publisher<? extends T> inputStream, ResolvableType elementType, MediaType mediaType, ReactiveHttpOutputMessage message, Map<String, Object> hints) reactor.core.publisher.Mono<Void>FormHttpMessageWriter.write(Publisher<? extends MultiValueMap<String, String>> inputStream, ResolvableType elementType, MediaType mediaType, ReactiveHttpOutputMessage message, Map<String, Object> hints) default reactor.core.publisher.Mono<Void>HttpMessageWriter.write(Publisher<? extends T> inputStream, ResolvableType actualType, ResolvableType elementType, MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response, Map<String, Object> hints) Server-side only alternative toHttpMessageWriter.write(Publisher, ResolvableType, MediaType, ReactiveHttpOutputMessage, Map)with additional context available.reactor.core.publisher.Mono<Void>HttpMessageWriter.write(Publisher<? extends T> inputStream, ResolvableType elementType, MediaType mediaType, ReactiveHttpOutputMessage message, Map<String, Object> hints) Write an given stream of object to the output message.reactor.core.publisher.Mono<Void>ResourceHttpMessageWriter.write(Publisher<? extends Resource> inputStream, ResolvableType actualType, ResolvableType elementType, MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response, Map<String, Object> hints) reactor.core.publisher.Mono<Void>ResourceHttpMessageWriter.write(Publisher<? extends Resource> inputStream, ResolvableType elementType, MediaType mediaType, ReactiveHttpOutputMessage message, Map<String, Object> hints) reactor.core.publisher.Mono<Void>ServerSentEventHttpMessageWriter.write(Publisher<?> input, ResolvableType actualType, ResolvableType elementType, MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response, Map<String, Object> hints) reactor.core.publisher.Mono<Void>ServerSentEventHttpMessageWriter.write(Publisher<?> input, ResolvableType elementType, MediaType mediaType, ReactiveHttpOutputMessage message, Map<String, Object> hints) -
Uses of MediaType in org.springframework.http.codec.json
Methods in org.springframework.http.codec.json that return types with arguments of type MediaTypeMethods in org.springframework.http.codec.json with parameters of type MediaTypeModifier and TypeMethodDescriptionAbstractJackson2Encoder.getEncodeHints(ResolvableType actualType, ResolvableType elementType, MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response) Method parameters in org.springframework.http.codec.json with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidAbstractJackson2Encoder.setStreamingMediaTypes(List<MediaType> mediaTypes) Configure "streaming" media types for which flushing should be performed automatically vs at the end of the stream. -
Uses of MediaType in org.springframework.http.codec.multipart
Methods in org.springframework.http.codec.multipart that return MediaTypeModifier and TypeMethodDescriptionprotected MediaTypeMultipartWriterSupport.getMultipartMediaType(MediaType mediaType, byte[] boundary) Prepare theMediaTypeto use by adding "boundary" and "charset" parameters to the givenmediaTypeor "mulitpart/form-data" otherwise by default.Methods in org.springframework.http.codec.multipart that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionDefaultPartHttpMessageReader.getReadableMediaTypes()MultipartHttpMessageReader.getReadableMediaTypes()MultipartWriterSupport.getWritableMediaTypes()Methods in org.springframework.http.codec.multipart with parameters of type MediaTypeModifier and TypeMethodDescriptionbooleanDefaultPartHttpMessageReader.canRead(ResolvableType elementType, MediaType mediaType) booleanMultipartHttpMessageReader.canRead(ResolvableType elementType, MediaType mediaType) booleanMultipartWriterSupport.canWrite(ResolvableType elementType, MediaType mediaType) protected MediaTypeMultipartWriterSupport.getMultipartMediaType(MediaType mediaType, byte[] boundary) Prepare theMediaTypeto use by adding "boundary" and "charset" parameters to the givenmediaTypeor "mulitpart/form-data" otherwise by default.reactor.core.publisher.Mono<Void>MultipartHttpMessageWriter.write(Publisher<? extends MultiValueMap<String, ?>> inputStream, ResolvableType elementType, MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String, Object> hints) reactor.core.publisher.Mono<Void>PartHttpMessageWriter.write(Publisher<? extends Part> parts, ResolvableType elementType, MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String, Object> hints) Constructor parameters in org.springframework.http.codec.multipart with type arguments of type MediaTypeModifierConstructorDescriptionprotectedMultipartWriterSupport(List<MediaType> supportedMediaTypes) Constructor with the list of supported media types. -
Uses of MediaType in org.springframework.http.codec.protobuf
Methods in org.springframework.http.codec.protobuf that return types with arguments of type MediaTypeMethods in org.springframework.http.codec.protobuf with parameters of type MediaTypeModifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>ProtobufHttpMessageWriter.write(Publisher<? extends com.google.protobuf.Message> inputStream, ResolvableType elementType, MediaType mediaType, ReactiveHttpOutputMessage message, Map<String, Object> hints) -
Uses of MediaType in org.springframework.http.converter
Methods in org.springframework.http.converter that return MediaTypeModifier and TypeMethodDescriptionprotected MediaTypeAbstractHttpMessageConverter.getDefaultContentType(T t) Returns the default content type for the given type.BufferedImageHttpMessageConverter.getDefaultContentType()Returns the defaultContent-Typeto be used for writing.protected MediaTypeResourceHttpMessageConverter.getDefaultContentType(Resource resource) protected MediaTypeResourceRegionHttpMessageConverter.getDefaultContentType(Object object) protected MediaTypeFormHttpMessageConverter.getFormContentType(MediaType contentType) Return the content type used to write forms, given the preferred content type.Methods in org.springframework.http.converter that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionAbstractHttpMessageConverter.getSupportedMediaTypes()BufferedImageHttpMessageConverter.getSupportedMediaTypes()FormHttpMessageConverter.getSupportedMediaTypes()Return the list of media types supported by this converter.HttpMessageConverter.getSupportedMediaTypes()Return the list of media types supported by this converter.HttpMessageConverter.getSupportedMediaTypes(Class<?> clazz) Return the list of media types supported by this converter for the given class.Methods in org.springframework.http.converter with parameters of type MediaTypeModifier and TypeMethodDescriptionprotected voidAbstractHttpMessageConverter.addDefaultHeaders(HttpHeaders headers, T t, MediaType contentType) Add default headers to the output message.protected voidStringHttpMessageConverter.addDefaultHeaders(HttpHeaders headers, String s, MediaType type) voidFormHttpMessageConverter.addSupportedMediaTypes(MediaType... supportedMediaTypes) AddMediaTypeobjects to be supported by this converter.booleanbooleanThis implementation checks if the given class is supported, and if the supported media types include the given media type.protected booleanbooleanbooleanbooleanIndicates whether the given type can be read by this converter.booleanIndicates whether the given class can be read by this converter.booleanbooleanbooleanbooleanbooleanprotected booleanReturnstrueif the given media type includes any of the supported media types.booleanbooleanbooleanIndicates whether the given class can be written by this converter.booleanIndicates whether the given class can be written by this converter.booleanbooleanbooleanprotected LongAbstractHttpMessageConverter.getContentLength(T t, MediaType contentType) Returns the content length for the given type.protected LongByteArrayHttpMessageConverter.getContentLength(byte[] bytes, MediaType contentType) protected LongObjectToStringHttpMessageConverter.getContentLength(Object obj, MediaType contentType) protected LongResourceHttpMessageConverter.getContentLength(Resource resource, MediaType contentType) protected LongStringHttpMessageConverter.getContentLength(String str, MediaType contentType) protected MediaTypeFormHttpMessageConverter.getFormContentType(MediaType contentType) Return the content type used to write forms, given the preferred content type.voidBufferedImageHttpMessageConverter.setDefaultContentType(MediaType defaultContentType) Sets the defaultContent-Typeto be used for writing.final voidAbstractGenericHttpMessageConverter.write(T t, Type type, MediaType contentType, HttpOutputMessage outputMessage) This implementation sets the default headers by callingAbstractHttpMessageConverter.addDefaultHeaders(org.springframework.http.HttpHeaders, T, org.springframework.http.MediaType), and then callsAbstractGenericHttpMessageConverter.writeInternal(T, org.springframework.http.HttpOutputMessage).final voidAbstractHttpMessageConverter.write(T t, MediaType contentType, HttpOutputMessage outputMessage) This implementation sets the default headers by callingAbstractHttpMessageConverter.addDefaultHeaders(org.springframework.http.HttpHeaders, T, org.springframework.http.MediaType), and then callsAbstractHttpMessageConverter.writeInternal(T, org.springframework.http.HttpOutputMessage).voidBufferedImageHttpMessageConverter.write(BufferedImage image, MediaType contentType, HttpOutputMessage outputMessage) voidFormHttpMessageConverter.write(MultiValueMap<String, ?> map, MediaType contentType, HttpOutputMessage outputMessage) voidGenericHttpMessageConverter.write(T t, Type type, MediaType contentType, HttpOutputMessage outputMessage) Write an given object to the given output message.voidHttpMessageConverter.write(T t, MediaType contentType, HttpOutputMessage outputMessage) Write an given object to the given output message.Method parameters in org.springframework.http.converter with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidAbstractHttpMessageConverter.setSupportedMediaTypes(List<MediaType> supportedMediaTypes) Set the list ofMediaTypeobjects supported by this converter.voidFormHttpMessageConverter.setSupportedMediaTypes(List<MediaType> supportedMediaTypes) Set the list ofMediaTypeobjects supported by this converter.Constructors in org.springframework.http.converter with parameters of type MediaTypeModifierConstructorDescriptionprotectedAbstractGenericHttpMessageConverter(MediaType supportedMediaType) Construct anAbstractGenericHttpMessageConverterwith one supported media type.protectedAbstractGenericHttpMessageConverter(MediaType... supportedMediaTypes) Construct anAbstractGenericHttpMessageConverterwith multiple supported media type.protectedAbstractHttpMessageConverter(Charset defaultCharset, MediaType... supportedMediaTypes) Construct anAbstractHttpMessageConverterwith a default charset and multiple supported media types.protectedAbstractHttpMessageConverter(MediaType supportedMediaType) Construct anAbstractHttpMessageConverterwith one supported media type.protectedAbstractHttpMessageConverter(MediaType... supportedMediaTypes) Construct anAbstractHttpMessageConverterwith multiple supported media types. -
Uses of MediaType in org.springframework.http.converter.feed
Constructors in org.springframework.http.converter.feed with parameters of type MediaTypeModifierConstructorDescriptionprotectedAbstractWireFeedHttpMessageConverter(MediaType supportedMediaType) -
Uses of MediaType in org.springframework.http.converter.json
Methods in org.springframework.http.converter.json that return MediaTypeModifier and TypeMethodDescriptionprotected MediaTypeAbstractJackson2HttpMessageConverter.getDefaultContentType(Object object) Methods in org.springframework.http.converter.json that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionAbstractJackson2HttpMessageConverter.getObjectMappersForType(Class<?> clazz) Return ObjectMapper registrations for the given class, if any.AbstractJackson2HttpMessageConverter.getSupportedMediaTypes(Class<?> clazz) Methods in org.springframework.http.converter.json with parameters of type MediaTypeModifier and TypeMethodDescriptionbooleanbooleanbooleanKotlinSerializationJsonHttpMessageConverter.canRead(Type type, Class<?> contextClass, MediaType mediaType) booleanbooleanKotlinSerializationJsonHttpMessageConverter.canWrite(Type type, Class<?> clazz, MediaType mediaType) protected CharsetAbstractJackson2HttpMessageConverter.getCharset(MediaType contentType) Determine the charset to use for JSON input.protected LongAbstractJackson2HttpMessageConverter.getContentLength(Object object, MediaType contentType) protected JsonEncodingAbstractJackson2HttpMessageConverter.getJsonEncoding(MediaType contentType) Determine the JSON encoding to use for the given content type.Method parameters in org.springframework.http.converter.json with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidAbstractJackson2HttpMessageConverter.registerObjectMappersForType(Class<?> clazz, Consumer<Map<MediaType, ObjectMapper>> registrar) Configure theObjectMapperinstances to use for the givenClass.Constructors in org.springframework.http.converter.json with parameters of type MediaTypeModifierConstructorDescriptionprotectedAbstractJackson2HttpMessageConverter(ObjectMapper objectMapper, MediaType supportedMediaType) protectedAbstractJackson2HttpMessageConverter(ObjectMapper objectMapper, MediaType... supportedMediaTypes) -
Uses of MediaType in org.springframework.http.converter.protobuf
Fields in org.springframework.http.converter.protobuf declared as MediaTypeModifier and TypeFieldDescriptionstatic final MediaTypeProtobufHttpMessageConverter.PROTOBUFThe media-type for protobufapplication/x-protobuf.Methods in org.springframework.http.converter.protobuf that return MediaTypeModifier and TypeMethodDescriptionprotected MediaTypeProtobufHttpMessageConverter.getDefaultContentType(com.google.protobuf.Message message) Methods in org.springframework.http.converter.protobuf with parameters of type MediaType -
Uses of MediaType in org.springframework.http.converter.xml
Methods in org.springframework.http.converter.xml with parameters of type MediaTypeModifier and TypeMethodDescriptionbooleanAlways returnsfalsesince Jaxb2CollectionHttpMessageConverter required generic type information in order to read a Collection.booleanIndicates whether the given type can be read by this converter.booleanbooleanbooleanAlways returnsfalsesince Jaxb2CollectionHttpMessageConverter does not convert collections to XML.booleanAlways returnsfalsesince Jaxb2CollectionHttpMessageConverter does not convert collections to XML.booleanbooleanprotected LongSourceHttpMessageConverter.getContentLength(T t, MediaType contentType) voidJaxb2CollectionHttpMessageConverter.write(T t, Type type, MediaType contentType, HttpOutputMessage outputMessage) -
Uses of MediaType in org.springframework.mock.http.server.reactive
Methods in org.springframework.mock.http.server.reactive with parameters of type MediaTypeModifier and TypeMethodDescriptionSet the list of acceptable media types, as specified by theAcceptheader.MockServerHttpRequest.BodyBuilder.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader. -
Uses of MediaType in org.springframework.mock.web
Methods in org.springframework.mock.web with parameters of type MediaTypeModifier and TypeMethodDescriptionvoidMockServletContext.addMimeType(String fileExtension, MediaType mimeType) Adds a mime type mapping for use byMockServletContext.getMimeType(String). -
Uses of MediaType in org.springframework.test.web.client.match
Methods in org.springframework.test.web.client.match with parameters of type MediaTypeModifier and TypeMethodDescriptionContentRequestMatchers.contentType(MediaType expectedContentType) Assert the request content type as aMediaType.ContentRequestMatchers.contentTypeCompatibleWith(MediaType contentType) Assert the request content type is compatible with the given content type as defined byisCompatibleWith(MediaType). -
Uses of MediaType in org.springframework.test.web.client.response
Methods in org.springframework.test.web.client.response with parameters of type MediaTypeModifier and TypeMethodDescriptionDefaultResponseCreator.contentType(MediaType mediaType) Set theContent-Typeheader.static DefaultResponseCreatorMockRestResponseCreators.withSuccess(byte[] body, MediaType contentType) ResponseCreatorfor a 200 response (OK) with byte[] body.static DefaultResponseCreatorMockRestResponseCreators.withSuccess(String body, MediaType contentType) ResponseCreatorfor a 200 response (OK) with String body.static DefaultResponseCreatorMockRestResponseCreators.withSuccess(Resource body, MediaType contentType) ResponseCreatorfor a 200 response (OK) content withResource-based body. -
Uses of MediaType in org.springframework.test.web.reactive.server
Methods in org.springframework.test.web.reactive.server with parameters of type MediaTypeModifier and TypeMethodDescriptionSet the list of acceptable media types, as specified by theAcceptheader.HeaderAssertions.contentType(MediaType mediaType) Expect a "Content-Type" header with the given value.WebTestClient.RequestBodySpec.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader.HeaderAssertions.contentTypeCompatibleWith(MediaType mediaType) Expect a "Content-Type" header compatible with the given value. -
Uses of MediaType in org.springframework.test.web.servlet.request
Methods in org.springframework.test.web.servlet.request with parameters of type MediaTypeModifier and TypeMethodDescriptionSet the 'Accept' header to the given media type(s).MockHttpServletRequestBuilder.contentType(MediaType contentType) Set the 'Content-Type' header of the request. -
Uses of MediaType in org.springframework.test.web.servlet.result
Methods in org.springframework.test.web.servlet.result with parameters of type MediaTypeModifier and TypeMethodDescriptionContentResultMatchers.contentType(MediaType contentType) Assert the ServletResponse content type after parsing it as a MediaType.ContentResultMatchers.contentTypeCompatibleWith(MediaType contentType) Assert the ServletResponse content type is compatible with the given content type as defined byisCompatibleWith(MediaType). -
Uses of MediaType in org.springframework.web
Methods in org.springframework.web that return MediaTypeModifier and TypeMethodDescriptionHttpMediaTypeNotSupportedException.getContentType()Return the HTTP request content type method that caused the failure.Methods in org.springframework.web that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionHttpMediaTypeException.getSupportedMediaTypes()Return the list of supported media types.Constructors in org.springframework.web with parameters of type MediaTypeModifierConstructorDescriptionHttpMediaTypeNotSupportedException(MediaType contentType, List<MediaType> mediaTypes) Create a new HttpMediaTypeNotSupportedException.HttpMediaTypeNotSupportedException(MediaType contentType, List<MediaType> mediaTypes, HttpMethod httpMethod) Create a new HttpMediaTypeNotSupportedException.HttpMediaTypeNotSupportedException(MediaType contentType, List<MediaType> supportedMediaTypes, HttpMethod httpMethod, String message) Create a new HttpMediaTypeNotSupportedException.Constructor parameters in org.springframework.web with type arguments of type MediaTypeModifierConstructorDescriptionprotectedHttpMediaTypeException(String message, List<MediaType> supportedMediaTypes) Create a new HttpMediaTypeException with a list of supported media types.HttpMediaTypeNotAcceptableException(List<MediaType> mediaTypes) Create a new HttpMediaTypeNotSupportedException.HttpMediaTypeNotSupportedException(MediaType contentType, List<MediaType> mediaTypes) Create a new HttpMediaTypeNotSupportedException.HttpMediaTypeNotSupportedException(MediaType contentType, List<MediaType> mediaTypes, HttpMethod httpMethod) Create a new HttpMediaTypeNotSupportedException.HttpMediaTypeNotSupportedException(MediaType contentType, List<MediaType> supportedMediaTypes, HttpMethod httpMethod, String message) Create a new HttpMediaTypeNotSupportedException. -
Uses of MediaType in org.springframework.web.accept
Fields in org.springframework.web.accept with type parameters of type MediaTypeModifier and TypeFieldDescriptionContentNegotiationStrategy.MEDIA_TYPE_ALL_LISTA singleton list withALLthat is returned fromContentNegotiationStrategy.resolveMediaTypes(org.springframework.web.context.request.NativeWebRequest)when no specific media types are requested.Methods in org.springframework.web.accept that return MediaTypeModifier and TypeMethodDescriptionPathExtensionContentNegotiationStrategy.getMediaTypeForResource(Resource resource) Deprecated.ServletPathExtensionContentNegotiationStrategy.getMediaTypeForResource(Resource resource) Deprecated.Extends the base classPathExtensionContentNegotiationStrategy.getMediaTypeForResource(org.springframework.core.io.Resource)with the ability to also look up through the ServletContext.protected MediaTypeAbstractMappingContentNegotiationStrategy.handleNoMatch(NativeWebRequest request, String key) Override to provide handling when a key is not resolved via.protected MediaTypeServletPathExtensionContentNegotiationStrategy.handleNoMatch(NativeWebRequest webRequest, String extension) Deprecated.Resolve file extension viaServletContext.getMimeType(String)and also delegate to base class for a potentialMediaTypeFactorylookup.protected MediaTypeMappingMediaTypeFileExtensionResolver.lookupMediaType(String extension) Use this method for a reverse lookup from extension to MediaType.Methods in org.springframework.web.accept that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionMappingMediaTypeFileExtensionResolver.getAllMediaTypes()FixedContentNegotiationStrategy.getContentTypes()Return the configured list of media types.ContentNegotiationManager.getMediaTypeMappings()Return all registered lookup key to media type mappings by iteratingMediaTypeFileExtensionResolvers.MappingMediaTypeFileExtensionResolver.getMediaTypes()AbstractMappingContentNegotiationStrategy.resolveMediaTypeKey(NativeWebRequest webRequest, String key) An alternative toAbstractMappingContentNegotiationStrategy.resolveMediaTypes(NativeWebRequest)that accepts an already extracted key.AbstractMappingContentNegotiationStrategy.resolveMediaTypes(NativeWebRequest webRequest) ContentNegotiationManager.resolveMediaTypes(NativeWebRequest request) ContentNegotiationStrategy.resolveMediaTypes(NativeWebRequest webRequest) Resolve the given request to a list of media types.FixedContentNegotiationStrategy.resolveMediaTypes(NativeWebRequest request) HeaderContentNegotiationStrategy.resolveMediaTypes(NativeWebRequest request) Resolve the given request to a list of media types.Methods in org.springframework.web.accept with parameters of type MediaTypeModifier and TypeMethodDescriptionprotected voidMappingMediaTypeFileExtensionResolver.addMapping(String extension, MediaType mediaType) Map an extension to a MediaType.voidContentNegotiationManagerFactoryBean.addMediaType(String key, MediaType mediaType) An alternative toContentNegotiationManagerFactoryBean.setMediaTypes(java.util.Properties)for programmatic registrations.protected voidAbstractMappingContentNegotiationStrategy.handleMatch(String key, MediaType mediaType) Override to provide handling when a key is successfully resolved viaMappingMediaTypeFileExtensionResolver.lookupMediaType(java.lang.String).ContentNegotiationManager.resolveFileExtensions(MediaType mediaType) MappingMediaTypeFileExtensionResolver.resolveFileExtensions(MediaType mediaType) MediaTypeFileExtensionResolver.resolveFileExtensions(MediaType mediaType) Resolve the given media type to a list of file extensions.voidContentNegotiationManagerFactoryBean.setDefaultContentType(MediaType contentType) Set the default content type to use when no content type is requested.Method parameters in org.springframework.web.accept with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidContentNegotiationManagerFactoryBean.addMediaTypes(Map<String, MediaType> mediaTypes) An alternative toContentNegotiationManagerFactoryBean.setMediaTypes(java.util.Properties)for programmatic registrations.voidContentNegotiationManagerFactoryBean.setDefaultContentTypes(List<MediaType> contentTypes) Set the default content types to use when no content type is requested.Constructors in org.springframework.web.accept with parameters of type MediaTypeModifierConstructorDescriptionFixedContentNegotiationStrategy(MediaType contentType) Constructor with a single defaultMediaType.Constructor parameters in org.springframework.web.accept with type arguments of type MediaTypeModifierConstructorDescriptionAbstractMappingContentNegotiationStrategy(Map<String, MediaType> mediaTypes) Create an instance with the given map of file extensions and media types.FixedContentNegotiationStrategy(List<MediaType> contentTypes) Constructor with an ordered List of defaultMediaType's to return for use in applications that support a variety of content types.MappingMediaTypeFileExtensionResolver(Map<String, MediaType> mediaTypes) Create an instance with the given map of file extensions and media types.ParameterContentNegotiationStrategy(Map<String, MediaType> mediaTypes) Create an instance with the given map of file extensions and media types.PathExtensionContentNegotiationStrategy(Map<String, MediaType> mediaTypes) Deprecated.Create an instance with the given map of file extensions and media types.ServletPathExtensionContentNegotiationStrategy(ServletContext servletContext, Map<String, MediaType> mediaTypes) Deprecated.Create an instance with the given extension-to-MediaType lookup. -
Uses of MediaType in org.springframework.web.client
Methods in org.springframework.web.client that return MediaTypeModifier and TypeMethodDescriptionprotected MediaTypeHttpMessageConverterExtractor.getContentType(ClientHttpResponse response) Determine the Content-Type of the response based on the "Content-Type" header or otherwise default toAPPLICATION_OCTET_STREAM.UnknownContentTypeException.getContentType()Return the content type of the response, or "application/octet-stream".Constructors in org.springframework.web.client with parameters of type MediaTypeModifierConstructorDescriptionUnknownContentTypeException(Type targetType, MediaType contentType, int statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody) Construct a new instance of with the given response data. -
Uses of MediaType in org.springframework.web.reactive.accept
Fields in org.springframework.web.reactive.accept with type parameters of type MediaTypeModifier and TypeFieldDescriptionRequestedContentTypeResolver.MEDIA_TYPE_ALL_LISTA singleton list withALLthat is returned fromRequestedContentTypeResolver.resolveMediaTypes(org.springframework.web.server.ServerWebExchange)when no specific media types are requested.Methods in org.springframework.web.reactive.accept that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionFixedContentTypeResolver.getContentTypes()Return the configured list of media types.FixedContentTypeResolver.resolveMediaTypes(ServerWebExchange exchange) HeaderContentTypeResolver.resolveMediaTypes(ServerWebExchange exchange) ParameterContentTypeResolver.resolveMediaTypes(ServerWebExchange exchange) RequestedContentTypeResolver.resolveMediaTypes(ServerWebExchange exchange) Resolve the given request to a list of requested media types.Methods in org.springframework.web.reactive.accept with parameters of type MediaTypeModifier and TypeMethodDescriptionvoidRequestedContentTypeResolverBuilder.fixedResolver(MediaType... mediaTypes) Add resolver that returns a fixed set of media types.RequestedContentTypeResolverBuilder.ParameterResolverConfigurer.mediaType(String key, MediaType mediaType) Configure a mapping between a lookup key (extracted from a query parameter value) and a correspondingMediaType.Method parameters in org.springframework.web.reactive.accept with type arguments of type MediaTypeModifier and TypeMethodDescriptionConstructors in org.springframework.web.reactive.accept with parameters of type MediaTypeModifierConstructorDescriptionFixedContentTypeResolver(MediaType mediaType) Constructor with a single defaultMediaType.Constructor parameters in org.springframework.web.reactive.accept with type arguments of type MediaTypeModifierConstructorDescriptionFixedContentTypeResolver(List<MediaType> contentTypes) Constructor with an ordered List of defaultMediaType's to return for use in applications that support a variety of content types.ParameterContentTypeResolver(Map<String, MediaType> mediaTypes) -
Uses of MediaType in org.springframework.web.reactive.config
Method parameters in org.springframework.web.reactive.config with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidResourceHandlerRegistration.setMediaTypes(Map<String, MediaType> mediaTypes) Add mappings between file extensions extracted from the filename of staticResources and the media types to use for the response. -
Uses of MediaType in org.springframework.web.reactive.function
Methods in org.springframework.web.reactive.function that return MediaTypeModifier and TypeMethodDescriptionUnsupportedMediaTypeException.getContentType()Return the request Content-Type header if it was parsed successfully, ornullotherwise.Methods in org.springframework.web.reactive.function that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionUnsupportedMediaTypeException.getSupportedMediaTypes()Return the list of supported content types in cases when the Content-Type header is parsed but not supported, or an empty list otherwise.Constructors in org.springframework.web.reactive.function with parameters of type MediaTypeModifierConstructorDescriptionUnsupportedMediaTypeException(MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported.UnsupportedMediaTypeException(MediaType contentType, List<MediaType> supportedTypes, ResolvableType bodyType) Constructor for when trying to encode from or decode to a specific Java type.Constructor parameters in org.springframework.web.reactive.function with type arguments of type MediaTypeModifierConstructorDescriptionUnsupportedMediaTypeException(MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported.UnsupportedMediaTypeException(MediaType contentType, List<MediaType> supportedTypes, ResolvableType bodyType) Constructor for when trying to encode from or decode to a specific Java type. -
Uses of MediaType in org.springframework.web.reactive.function.client
Methods in org.springframework.web.reactive.function.client that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionClientResponse.Headers.contentType()Return the media type of the body, as specified by theContent-Typeheader.Methods in org.springframework.web.reactive.function.client with parameters of type MediaTypeModifier and TypeMethodDescriptionSet the list of acceptable media types, as specified by theAcceptheader.WebClient.RequestBodySpec.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader. -
Uses of MediaType in org.springframework.web.reactive.function.client.support
Methods in org.springframework.web.reactive.function.client.support that return types with arguments of type MediaType -
Uses of MediaType in org.springframework.web.reactive.function.server
Methods in org.springframework.web.reactive.function.server that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionServerRequest.Headers.accept()Get the list of acceptable media types, as specified by theAcceptheader.ServerRequest.Headers.contentType()Get the media type of the body, as specified by theContent-Typeheader.Methods in org.springframework.web.reactive.function.server with parameters of type MediaTypeModifier and TypeMethodDescriptionstatic RequestPredicateReturn aRequestPredicatethat tests if the request's accept header is compatible with any of the given media types.EntityResponse.Builder.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader.static RequestPredicateRequestPredicates.contentType(MediaType... mediaTypes) Return aRequestPredicatethat tests if the request's content type is included by any of the given media types.ServerResponse.BodyBuilder.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader. -
Uses of MediaType in org.springframework.web.reactive.function.server.support
Methods in org.springframework.web.reactive.function.server.support that return types with arguments of type MediaType -
Uses of MediaType in org.springframework.web.reactive.resource
Methods in org.springframework.web.reactive.resource that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionResourceWebHandler.getMediaTypes()Return theconfiguredmedia type mappings.Methods in org.springframework.web.reactive.resource with parameters of type MediaTypeModifier and TypeMethodDescriptionprotected voidResourceWebHandler.setHeaders(ServerWebExchange exchange, Resource resource, MediaType mediaType) Set headers on the response.Method parameters in org.springframework.web.reactive.resource with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidResourceWebHandler.setMediaTypes(Map<String, MediaType> mediaTypes) Add mappings between file extensions extracted from the filename of staticResources and the media types to use for the response. -
Uses of MediaType in org.springframework.web.reactive.result
Methods in org.springframework.web.reactive.result that return MediaTypeModifier and TypeMethodDescriptionprotected MediaTypeHandlerResultHandlerSupport.selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier) Select the best media type for the current request through a content negotiation algorithm.Method parameters in org.springframework.web.reactive.result with type arguments of type MediaTypeModifier and TypeMethodDescriptionprotected MediaTypeHandlerResultHandlerSupport.selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier) Select the best media type for the current request through a content negotiation algorithm. -
Uses of MediaType in org.springframework.web.reactive.result.condition
Methods in org.springframework.web.reactive.result.condition that return MediaTypeMethods in org.springframework.web.reactive.result.condition that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionConsumesRequestCondition.getConsumableMediaTypes()Returns the media types for this condition excluding negated expressions.ProducesRequestCondition.getProducibleMediaTypes()Return the contained producible media types excluding negated expressions. -
Uses of MediaType in org.springframework.web.reactive.result.view
Fields in org.springframework.web.reactive.result.view declared as MediaTypeModifier and TypeFieldDescriptionstatic final MediaTypeViewResolverSupport.DEFAULT_CONTENT_TYPEThe defaultcontent-typefor views.Methods in org.springframework.web.reactive.result.view that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionAbstractView.getSupportedMediaTypes()Get the configured media types supported by this view.HttpMessageWriterView.getSupportedMediaTypes()Return the list of media types this View supports, or an empty list.View.getSupportedMediaTypes()Return the list of media types this View supports, or an empty list.ViewResolverSupport.getSupportedMediaTypes()Return the configured media types supported by this view.Methods in org.springframework.web.reactive.result.view with parameters of type MediaTypeModifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>AbstractView.render(Map<String, ?> model, MediaType contentType, ServerWebExchange exchange) Prepare the model to render.reactor.core.publisher.Mono<Void>HttpMessageWriterView.render(Map<String, ?> model, MediaType contentType, ServerWebExchange exchange) reactor.core.publisher.Mono<Void>View.render(Map<String, ?> model, MediaType contentType, ServerWebExchange exchange) Render the view based on the givenHandlerResult.protected abstract reactor.core.publisher.Mono<Void>AbstractView.renderInternal(Map<String, Object> renderAttributes, MediaType contentType, ServerWebExchange exchange) Subclasses must implement this method to actually render the view.protected reactor.core.publisher.Mono<Void>RedirectView.renderInternal(Map<String, Object> model, MediaType contentType, ServerWebExchange exchange) Convert model to request parameters and redirect to the given URL.Method parameters in org.springframework.web.reactive.result.view with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidAbstractView.setSupportedMediaTypes(List<MediaType> supportedMediaTypes) Set the supported media types for this view.voidViewResolverSupport.setSupportedMediaTypes(List<MediaType> supportedMediaTypes) Set the supported media types for this view. -
Uses of MediaType in org.springframework.web.reactive.result.view.freemarker
Methods in org.springframework.web.reactive.result.view.freemarker with parameters of type MediaTypeModifier and TypeMethodDescriptionprotected reactor.core.publisher.Mono<Void>FreeMarkerView.renderInternal(Map<String, Object> renderAttributes, MediaType contentType, ServerWebExchange exchange) -
Uses of MediaType in org.springframework.web.reactive.result.view.script
Methods in org.springframework.web.reactive.result.view.script with parameters of type MediaTypeModifier and TypeMethodDescriptionprotected reactor.core.publisher.Mono<Void>ScriptTemplateView.renderInternal(Map<String, Object> model, MediaType contentType, ServerWebExchange exchange) -
Uses of MediaType in org.springframework.web.server
Methods in org.springframework.web.server that return MediaTypeModifier and TypeMethodDescriptionUnsupportedMediaTypeStatusException.getContentType()Return the request Content-Type header if it was parsed successfully, ornullotherwise.Methods in org.springframework.web.server that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionNotAcceptableStatusException.getSupportedMediaTypes()Return the list of supported content types in cases when the Accept header is parsed but not supported, or an empty list otherwise.UnsupportedMediaTypeStatusException.getSupportedMediaTypes()Return the list of supported content types in cases when the Content-Type header is parsed but not supported, or an empty list otherwise.Constructors in org.springframework.web.server with parameters of type MediaTypeModifierConstructorDescriptionUnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported.UnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes, ResolvableType bodyType) Constructor for when trying to encode from or decode to a specific Java type.UnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes, ResolvableType bodyType, HttpMethod method) Constructor for when trying to encode from or decode to a specific Java type.UnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes, HttpMethod method) Constructor that provides the HTTP method.Constructor parameters in org.springframework.web.server with type arguments of type MediaTypeModifierConstructorDescriptionNotAcceptableStatusException(List<MediaType> mediaTypes) Constructor for when the requested Content-Type is not supported.UnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported.UnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes, ResolvableType bodyType) Constructor for when trying to encode from or decode to a specific Java type.UnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes, ResolvableType bodyType, HttpMethod method) Constructor for when trying to encode from or decode to a specific Java type.UnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes, HttpMethod method) Constructor that provides the HTTP method. -
Uses of MediaType in org.springframework.web.servlet.config.annotation
Methods in org.springframework.web.servlet.config.annotation that return types with arguments of type MediaTypeMethods in org.springframework.web.servlet.config.annotation with parameters of type MediaTypeModifier and TypeMethodDescriptionContentNegotiationConfigurer.defaultContentType(MediaType... defaultContentTypes) Set the default content type(s) to use when no content type is requested in order of priority.Add a mapping from a key, extracted from a path extension or a query parameter, to a MediaType.Method parameters in org.springframework.web.servlet.config.annotation with type arguments of type MediaTypeModifier and TypeMethodDescriptionContentNegotiationConfigurer.mediaTypes(Map<String, MediaType> mediaTypes) ContentNegotiationConfigurer.replaceMediaTypes(Map<String, MediaType> mediaTypes) Similar toContentNegotiationConfigurer.mediaType(java.lang.String, org.springframework.http.MediaType)but for replacing existing mappings. -
Uses of MediaType in org.springframework.web.servlet.function
Methods in org.springframework.web.servlet.function that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionServerRequest.Headers.accept()Get the list of acceptable media types, as specified by theAcceptheader.ServerRequest.Headers.contentType()Get the media type of the body, as specified by theContent-Typeheader.Methods in org.springframework.web.servlet.function with parameters of type MediaTypeModifier and TypeMethodDescriptionstatic RequestPredicateReturn aRequestPredicatethat tests if the request's accept header is compatible with any of the given media types.EntityResponse.Builder.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader.static RequestPredicateRequestPredicates.contentType(MediaType... mediaTypes) Return aRequestPredicatethat tests if the request's content type is included by any of the given media types.ServerResponse.BodyBuilder.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader. -
Uses of MediaType in org.springframework.web.servlet.mvc.condition
Methods in org.springframework.web.servlet.mvc.condition that return MediaTypeMethods in org.springframework.web.servlet.mvc.condition that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionConsumesRequestCondition.getConsumableMediaTypes()Returns the media types for this condition excluding negated expressions.ProducesRequestCondition.getProducibleMediaTypes()Return the contained producible media types excluding negated expressions. -
Uses of MediaType in org.springframework.web.servlet.mvc.method.annotation
Methods in org.springframework.web.servlet.mvc.method.annotation that return MediaTypeMethods in org.springframework.web.servlet.mvc.method.annotation that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionAbstractMessageConverterMethodProcessor.getProducibleMediaTypes(HttpServletRequest request, Class<?> valueClass) Returns the media types that can be produced.AbstractMessageConverterMethodProcessor.getProducibleMediaTypes(HttpServletRequest request, Class<?> valueClass, Type targetType) Returns the media types that can be produced.AbstractMessageConverterMethodArgumentResolver.getSupportedMediaTypes(Class<?> clazz) Return the media types supported by all provided message converters sorted by specificity viaMimeTypeUtils.sortBySpecificity(List).Methods in org.springframework.web.servlet.mvc.method.annotation with parameters of type MediaTypeModifier and TypeMethodDescriptionfinal ObjectAbstractMappingJacksonResponseBodyAdvice.beforeBodyWrite(Object body, MethodParameter returnType, MediaType contentType, Class<? extends HttpMessageConverter<?>> converterType, ServerHttpRequest request, ServerHttpResponse response) ResponseBodyAdvice.beforeBodyWrite(T body, MethodParameter returnType, MediaType selectedContentType, Class<? extends HttpMessageConverter<?>> selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) Invoked after anHttpMessageConverteris selected and just before its write method is invoked.protected abstract voidAbstractMappingJacksonResponseBodyAdvice.beforeBodyWriteInternal(MappingJacksonValue bodyContainer, MediaType contentType, MethodParameter returnType, ServerHttpRequest request, ServerHttpResponse response) Invoked only if the converter type isMappingJackson2HttpMessageConverter.protected voidJsonViewResponseBodyAdvice.beforeBodyWriteInternal(MappingJacksonValue bodyContainer, MediaType contentType, MethodParameter returnType, ServerHttpRequest request, ServerHttpResponse response) Add an SSE "data" line.voidOverloaded variant ofResponseBodyEmitter.send(Object)that also accepts a MediaType hint for how to serialize the given Object.voidSend the object formatted as a single SSE "data" line.Constructors in org.springframework.web.servlet.mvc.method.annotation with parameters of type MediaType -
Uses of MediaType in org.springframework.web.servlet.resource
Methods in org.springframework.web.servlet.resource that return MediaTypeModifier and TypeMethodDescriptionprotected MediaTypeResourceHttpRequestHandler.getMediaType(HttpServletRequest request, Resource resource) Determine the media type for the given request and the resource matched to it.Methods in org.springframework.web.servlet.resource that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionResourceHttpRequestHandler.getMediaTypes()Return theconfiguredmedia types.Methods in org.springframework.web.servlet.resource with parameters of type MediaTypeModifier and TypeMethodDescriptionprotected voidResourceHttpRequestHandler.setHeaders(HttpServletResponse response, Resource resource, MediaType mediaType) Set headers on the given servlet response.Method parameters in org.springframework.web.servlet.resource with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidResourceHttpRequestHandler.setMediaTypes(Map<String, MediaType> mediaTypes) Add mappings between file extensions, extracted from the filename of a staticResource, and corresponding media type to set on the response. -
Uses of MediaType in org.springframework.web.servlet.view
Methods in org.springframework.web.servlet.view that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionContentNegotiatingViewResolver.getMediaTypes(HttpServletRequest request) Determines the list ofMediaTypefor the givenHttpServletRequest. -
Uses of MediaType in org.springframework.web.socket.sockjs.transport.handler
Methods in org.springframework.web.socket.sockjs.transport.handler that return MediaTypeModifier and TypeMethodDescriptionprotected abstract MediaTypeAbstractHttpSendingTransportHandler.getContentType()protected MediaTypeEventSourceTransportHandler.getContentType()protected MediaTypeHtmlFileTransportHandler.getContentType()protected MediaTypeXhrPollingTransportHandler.getContentType()protected MediaTypeXhrStreamingTransportHandler.getContentType()
APPLICATION_JSONsince major browsers like Chrome now comply with the specification and interpret correctly UTF-8 special characters without requiring acharset=UTF-8parameter.