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 6.0 mock objects, targeted at usage with
Spring's Web MVC framework.
Test support for HTTP concepts.
Contains built-in
RequestMatcher
implementations.Contains built-in
ResponseCreator
implementations.Support for testing Spring WebFlux server endpoints via
WebTestClient.AssertJ support for WebTestClient.
AssertJ support for MockMvc.
Support for testing Spring MVC applications via
RestTestClient with
MockMvc for server request handling.AssertJ support for RestTestClient.
Contains built-in
RequestBuilder
implementations.Contains built-in
ResultMatcher and ResultHandler implementations.Support classes for testing web applications.
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.
Support classes for annotation-based handler method processing.
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 like an annotated controller or a simple
WebHandler.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.
Core interfaces and classes for Spring's generic, reactive web support.
Support for creating a client proxy for an HTTP service annotated with
HttpExchange methods.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.ALLMedia type for "*/*", including all media ranges.static final MediaTypeMediaType.APPLICATION_ATOM_XMLMedia type forapplication/atom+xml.static final MediaTypeMediaType.APPLICATION_CBORMedia type forapplication/cbor.static final MediaTypeMediaType.APPLICATION_FORM_URLENCODEDMedia type forapplication/x-www-form-urlencoded.static final MediaTypeMediaType.APPLICATION_GRAPHQL_RESPONSEMedia type forapplication/graphql-response+json.static final MediaTypeMediaType.APPLICATION_JSONMedia type forapplication/json.static final MediaTypeMediaType.APPLICATION_NDJSONMedia type forapplication/x-ndjson.static final MediaTypeMediaType.APPLICATION_OCTET_STREAMMedia type forapplication/octet-stream.static final MediaTypeMediaType.APPLICATION_PDFMedia type forapplication/pdf.static final MediaTypeMediaType.APPLICATION_PROBLEM_JSONMedia type forapplication/problem+json.static final MediaTypeMediaType.APPLICATION_PROBLEM_XMLMedia type forapplication/problem+xml.static final MediaTypeMediaType.APPLICATION_PROTOBUFMedia type forapplication/x-protobuf.static final MediaTypeMediaType.APPLICATION_RSS_XMLMedia type forapplication/rss+xml.static final MediaTypeMediaType.APPLICATION_XHTML_XMLMedia type forapplication/xhtml+xml.static final MediaTypeMediaType.APPLICATION_XMLMedia type forapplication/xml.static final MediaTypeMediaType.APPLICATION_YAMLMedia type forapplication/yaml.static final MediaTypeMediaType.IMAGE_GIFMedia type forimage/gif.static final MediaTypeMediaType.IMAGE_JPEGMedia type forimage/jpeg.static final MediaTypeMediaType.IMAGE_PNGMedia type forimage/png.static final MediaTypeMediaType.MULTIPART_FORM_DATAMedia type formultipart/form-data.static final MediaTypeMediaType.MULTIPART_MIXEDMedia type formultipart/mixed.static final MediaTypeMediaType.MULTIPART_RELATEDMedia type formultipart/related.static final MediaTypeMediaType.TEXT_EVENT_STREAMMedia type fortext/event-stream.static final MediaTypeMediaType.TEXT_HTMLMedia type fortext/html.static final MediaTypeMediaType.TEXT_MARKDOWNMedia type fortext/markdown.static final MediaTypeMediaType.TEXT_PLAINMedia type fortext/plain.static final MediaTypeMediaType.TEXT_XMLMedia type fortext/xml.Methods 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(@Nullable String filename) Determine a media type for the given file name, if possible.MediaTypeFactory.getMediaType(@Nullable Resource resource) Determine a media type for the given resource, if possible.MediaTypeFactory.getMediaTypes(@Nullable String filename) Determine the media types for the given file name, if possible.MediaType.parseMediaTypes(@Nullable String mediaTypes) Parse the comma-separated string into a list ofMediaTypeobjects.MediaType.parseMediaTypes(@Nullable 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(@Nullable MediaType other) Indicate whether thisMediaTypeis compatible with the given media type.voidHttpHeaders.setContentType(@Nullable 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 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 TypeMethodDescriptionDecoderHttpMessageReader.getContentType(HttpMessage inputMessage) Determine the Content-Type of the HTTP message based on the "Content-Type" header or otherwise default toMediaType.APPLICATION_OCTET_STREAM.protected MediaTypeFormHttpMessageWriter.getMediaType(@Nullable MediaType mediaType) Return the content type used to write forms, either the given media type or otherwiseapplication/x-www-form-urlencoded.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()AbstractJacksonEncoder.getStreamingMediaTypes()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 TypeMethodDescriptionResourceHttpMessageWriter.addDefaultHeaders(ReactiveHttpOutputMessage message, Resource resource, @Nullable MediaType contentType, Map<String, Object> hints) Adds the default headers for the given resource to the given message.booleanDecoderHttpMessageReader.canRead(ResolvableType elementType, @Nullable MediaType mediaType) booleanFormHttpMessageReader.canRead(ResolvableType elementType, @Nullable MediaType mediaType) booleanHttpMessageReader.canRead(ResolvableType elementType, @Nullable MediaType mediaType) Whether the given object type is supported by this reader.booleanServerSentEventHttpMessageReader.canRead(ResolvableType elementType, @Nullable MediaType mediaType) booleanEncoderHttpMessageWriter.canWrite(ResolvableType elementType, @Nullable MediaType mediaType) booleanFormHttpMessageWriter.canWrite(ResolvableType elementType, @Nullable MediaType mediaType) booleanHttpMessageWriter.canWrite(ResolvableType elementType, @Nullable MediaType mediaType) Whether the given object type is supported by this writer.booleanResourceHttpMessageWriter.canWrite(ResolvableType elementType, @Nullable MediaType mediaType) booleanServerSentEventHttpMessageWriter.canWrite(ResolvableType elementType, @Nullable MediaType mediaType) AbstractJacksonEncoder.getEncodeHints(@Nullable ResolvableType actualType, ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response) HttpMessageEncoder.getEncodeHints(ResolvableType actualType, ResolvableType elementType, @Nullable 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(@Nullable MediaType mediaType) Return the content type used to write forms, either the given media type or otherwiseapplication/x-www-form-urlencoded.EncoderHttpMessageWriter.getWriteHints(ResolvableType streamType, ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response) Get additional hints for encoding for example based on the server request or annotations from controller method parameters.EncoderHttpMessageWriter.write(Publisher<? extends T> inputStream, ResolvableType actualType, ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response, Map<String, Object> hints) EncoderHttpMessageWriter.write(Publisher<? extends T> inputStream, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage message, Map<String, Object> hints) FormHttpMessageWriter.write(Publisher<? extends MultiValueMap<String, String>> inputStream, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage message, Map<String, Object> hints) HttpMessageWriter.write(Publisher<? extends T> inputStream, ResolvableType actualType, ResolvableType elementType, @Nullable 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.HttpMessageWriter.write(Publisher<? extends T> inputStream, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage message, Map<String, Object> hints) Write a given stream of object to the output message.ResourceHttpMessageWriter.write(Publisher<? extends Resource> inputStream, @Nullable ResolvableType actualType, ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response, Map<String, Object> hints) ResourceHttpMessageWriter.write(Publisher<? extends Resource> inputStream, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage message, Map<String, Object> hints) ServerSentEventHttpMessageWriter.write(Publisher<?> input, ResolvableType actualType, ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response, Map<String, Object> hints) ServerSentEventHttpMessageWriter.write(Publisher<?> input, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage message, Map<String, Object> hints) Method parameters in org.springframework.http.codec with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidAbstractJacksonEncoder.setStreamingMediaTypes(List<MediaType> mediaTypes) Configure "streaming" media types for which flushing should be performed automatically vs at the end of the stream.voidKotlinSerializationStringEncoder.setStreamingMediaTypes(Collection<MediaType> streamingMediaTypes) Set streamingMediaTypes. -
Uses of MediaType in org.springframework.http.codec.json
Methods in org.springframework.http.codec.json that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionAbstractJackson2Encoder.getStreamingMediaTypes()Deprecated, for removal: This API element is subject to removal in a future version.GsonEncoder.getStreamingMediaTypes()Methods in org.springframework.http.codec.json with parameters of type MediaTypeModifier and TypeMethodDescriptionAbstractJackson2Encoder.getEncodeHints(@Nullable ResolvableType actualType, ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response) Deprecated, for removal: This API element is subject to removal in a future version.Method parameters in org.springframework.http.codec.json with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidAbstractJackson2Encoder.setStreamingMediaTypes(List<MediaType> mediaTypes) Deprecated, for removal: This API element is subject to removal in a future version.Configure "streaming" media types for which flushing should be performed automatically vs at the end of the stream.voidGsonEncoder.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(@Nullable MediaType mediaType, byte[] boundary) Prepare theMediaTypeto use by adding "boundary" and "charset" parameters to the givenmediaTypeor "multipart/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()PartEventHttpMessageReader.getReadableMediaTypes()MultipartWriterSupport.getWritableMediaTypes()Methods in org.springframework.http.codec.multipart with parameters of type MediaTypeModifier and TypeMethodDescriptionbooleanDefaultPartHttpMessageReader.canRead(ResolvableType elementType, @Nullable MediaType mediaType) booleanMultipartHttpMessageReader.canRead(ResolvableType elementType, @Nullable MediaType mediaType) booleanPartEventHttpMessageReader.canRead(ResolvableType elementType, @Nullable MediaType mediaType) booleanMultipartHttpMessageWriter.canWrite(ResolvableType elementType, @Nullable MediaType mediaType) booleanPartEventHttpMessageWriter.canWrite(ResolvableType elementType, @Nullable MediaType mediaType) booleanPartHttpMessageWriter.canWrite(ResolvableType elementType, @Nullable MediaType mediaType) static Flux<FilePartEvent> FilePartEvent.create(String partName, String filename, MediaType contentType, Flux<DataBuffer> contents) Creates a stream ofFilePartEventobjects based on the given name, FilePartEvent.filename(), content-type, and contents.static Flux<FilePartEvent> FilePartEvent.create(String partName, String filename, MediaType contentType, Flux<DataBuffer> contents, @Nullable Consumer<HttpHeaders> headersConsumer) Creates a stream ofFilePartEventobjects based on the given name, FilePartEvent.filename(), content-type, and contents.protected MediaTypeMultipartWriterSupport.getMultipartMediaType(@Nullable MediaType mediaType, byte[] boundary) Prepare theMediaTypeto use by adding "boundary" and "charset" parameters to the givenmediaTypeor "multipart/form-data" otherwise by default.MultipartHttpMessageWriter.write(Publisher<? extends MultiValueMap<String, ?>> inputStream, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String, Object> hints) PartEventHttpMessageWriter.write(Publisher<? extends PartEvent> partDataStream, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String, Object> hints) PartHttpMessageWriter.write(Publisher<? extends Part> parts, ResolvableType elementType, @Nullable 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 MediaTypeModifier and TypeMethodDescriptionprotected MediaTypeProtobufHttpMessageWriter.getStreamingContentType(@Nullable MediaType mediaType) Return theMediaTypeto use when the input Publisher is multivalued.Methods in org.springframework.http.codec.protobuf that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionProtobufEncoder.getStreamingMediaTypes()ProtobufJsonEncoder.getStreamingMediaTypes()Methods in org.springframework.http.codec.protobuf with parameters of type MediaTypeModifier and TypeMethodDescriptionprotected MediaTypeProtobufHttpMessageWriter.getStreamingContentType(@Nullable MediaType mediaType) Return theMediaTypeto use when the input Publisher is multivalued.ProtobufHttpMessageWriter.write(Publisher<? extends com.google.protobuf.Message> inputStream, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String, Object> hints) -
Uses of MediaType in org.springframework.http.converter
Methods in org.springframework.http.converter that return MediaTypeModifier and TypeMethodDescriptionAbstractHttpMessageConverter.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(@Nullable MediaType contentType) Return the content type used to write forms, either the given content type or otherwiseapplication/x-www-form-urlencoded.Methods in org.springframework.http.converter that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionAbstractJacksonHttpMessageConverter.getMappersForType(Class<?> clazz) Return ObjectMapper registrations for the given class, if any.AbstractJacksonHttpMessageConverter.getMediaTypesForProblemDetail()Return the supported media type(s) forProblemDetail.AbstractHttpMessageConverter.getSupportedMediaTypes()AbstractJacksonHttpMessageConverter.getSupportedMediaTypes(Class<?> clazz) AbstractKotlinSerializationHttpMessageConverter.getSupportedMediaTypes(Class<?> clazz) 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, @Nullable MediaType contentType) Add default headers to the output message.voidResourceHttpMessageConverter.addDefaultHeaders(HttpOutputMessage message, Resource resource, @Nullable MediaType contentType) Add the default headers for the given resource to the given message.protected voidStringHttpMessageConverter.addDefaultHeaders(HttpHeaders headers, String s, @Nullable MediaType type) voidFormHttpMessageConverter.addSupportedMediaTypes(MediaType... supportedMediaTypes) AddMediaTypeobjects to be supported by this converter.booleanAbstractGenericHttpMessageConverter.canRead(Type type, @Nullable Class<?> contextClass, @Nullable MediaType mediaType) booleanThis implementation checks if the given class is supported, and if the supported media types include the given media type.protected booleanbooleanAbstractJacksonHttpMessageConverter.canRead(ResolvableType type, @Nullable MediaType mediaType) booleanAbstractKotlinSerializationHttpMessageConverter.canRead(ResolvableType type, @Nullable MediaType mediaType) booleanbooleanbooleanbooleanGenericHttpMessageConverter.canRead(Type type, @Nullable Class<?> contextClass, @Nullable MediaType mediaType) Indicates whether the given type can be read by this converter.booleanIndicates whether the given class can be read by this converter.booleanbooleanbooleanResourceRegionHttpMessageConverter.canRead(Type type, @Nullable Class<?> contextClass, @Nullable MediaType mediaType) default booleanbooleanSmartHttpMessageConverter.canRead(ResolvableType type, @Nullable MediaType mediaType) Indicates whether the given type can be read by this converter.booleanAbstractGenericHttpMessageConverter.canWrite(@Nullable Type type, Class<?> clazz, @Nullable MediaType mediaType) booleanprotected booleanReturnstrueif the given media type includes any of the supported media types.booleanAbstractJacksonHttpMessageConverter.canWrite(ResolvableType type, Class<?> valueClass, @Nullable MediaType mediaType) booleanAbstractKotlinSerializationHttpMessageConverter.canWrite(ResolvableType type, Class<?> valueClass, @Nullable MediaType mediaType) booleanbooleanbooleanbooleanGenericHttpMessageConverter.canWrite(@Nullable Type type, Class<?> clazz, @Nullable MediaType mediaType) Indicates whether the given class can be written by this converter.booleanIndicates whether the given class can be written by this converter.booleanbooleanbooleanResourceRegionHttpMessageConverter.canWrite(@Nullable Type type, @Nullable Class<?> clazz, @Nullable MediaType mediaType) default booleanbooleanSmartHttpMessageConverter.canWrite(ResolvableType targetType, Class<?> valueClass, @Nullable MediaType mediaType) Indicates whether the given class can be written by this converter.protected tools.jackson.databind.ObjectWriterAbstractJacksonHttpMessageConverter.customizeWriter(tools.jackson.databind.ObjectWriter writer, @Nullable tools.jackson.databind.JavaType javaType, @Nullable MediaType contentType) Subclasses can use this method to customize theObjectWriterused for writing values.protected CharsetAbstractJacksonHttpMessageConverter.getCharset(@Nullable MediaType contentType) Determine the charset to use for JSON input.AbstractHttpMessageConverter.getContentLength(T t, @Nullable MediaType contentType) Returns the content length for the given type.protected LongByteArrayHttpMessageConverter.getContentLength(byte[] bytes, @Nullable MediaType contentType) protected LongObjectToStringHttpMessageConverter.getContentLength(Object obj, @Nullable MediaType contentType) ResourceHttpMessageConverter.getContentLength(Resource resource, @Nullable MediaType contentType) protected LongStringHttpMessageConverter.getContentLength(String str, @Nullable MediaType contentType) protected MediaTypeFormHttpMessageConverter.getFormContentType(@Nullable MediaType contentType) Return the content type used to write forms, either the given content type or otherwiseapplication/x-www-form-urlencoded.protected tools.jackson.core.JsonEncodingAbstractJacksonHttpMessageConverter.getJsonEncoding(@Nullable MediaType contentType) Determine the JSON encoding to use for the given content type.voidBufferedImageHttpMessageConverter.setDefaultContentType(@Nullable MediaType defaultContentType) Sets the defaultContent-Typeto be used for writing.final voidAbstractGenericHttpMessageConverter.write(T t, @Nullable Type type, @Nullable MediaType contentType, HttpOutputMessage outputMessage) This implementation sets the default headers by callingAbstractHttpMessageConverter.addDefaultHeaders(HttpHeaders, T, MediaType), and then callsAbstractGenericHttpMessageConverter.writeInternal(T, HttpOutputMessage).final voidAbstractHttpMessageConverter.write(T t, @Nullable MediaType contentType, HttpOutputMessage outputMessage) This implementation sets the default headers by callingAbstractHttpMessageConverter.addDefaultHeaders(HttpHeaders, T, MediaType), and then callsAbstractHttpMessageConverter.writeInternal(T, HttpOutputMessage).final voidAbstractSmartHttpMessageConverter.write(T t, ResolvableType type, @Nullable MediaType contentType, HttpOutputMessage outputMessage, @Nullable Map<String, Object> hints) This implementation sets the default headers by callingAbstractHttpMessageConverter.addDefaultHeaders(HttpHeaders, T, MediaType), and then callsAbstractSmartHttpMessageConverter.writeInternal(T, HttpOutputMessage).voidBufferedImageHttpMessageConverter.write(BufferedImage image, @Nullable MediaType contentType, HttpOutputMessage outputMessage) voidFormHttpMessageConverter.write(MultiValueMap<String, ?> map, @Nullable MediaType contentType, HttpOutputMessage outputMessage) voidGenericHttpMessageConverter.write(T t, @Nullable Type type, @Nullable MediaType contentType, HttpOutputMessage outputMessage) Write a given object to the given output message.voidHttpMessageConverter.write(T t, @Nullable MediaType contentType, HttpOutputMessage outputMessage) Write a given object to the given output message.voidSmartHttpMessageConverter.write(T t, ResolvableType type, @Nullable MediaType contentType, HttpOutputMessage outputMessage, @Nullable Map<String, Object> hints) Write a given object to the given output message.default voidSmartHttpMessageConverter.write(T t, @Nullable MediaType contentType, HttpOutputMessage outputMessage) Method parameters in org.springframework.http.converter with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidAbstractJacksonHttpMessageConverter.registerMappersForType(Class<?> clazz, Consumer<Map<MediaType, T>> registrar) Configure theObjectMapperinstances to use for the givenClass.voidAbstractHttpMessageConverter.setSupportedMediaTypes(List<MediaType> supportedMediaTypes) Set the list ofMediaTypeobjects supported by this converter.voidAbstractJacksonHttpMessageConverter.setSupportedMediaTypes(List<MediaType> supportedMediaTypes) voidFormHttpMessageConverter.setSupportedMediaTypes(List<MediaType> supportedMediaTypes) Set the list ofMediaTypeobjects supported by this converter.Constructors in org.springframework.http.converter with parameters of type MediaTypeModifierConstructorDescriptionprotectedAbstractGenericHttpMessageConverter(Charset defaultCharset, MediaType... supportedMediaTypes) Construct anAbstractGenericHttpMessageConverterwith a default charset and multiple supported media types.protectedAbstractGenericHttpMessageConverter(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.protectedAbstractJacksonHttpMessageConverter(tools.jackson.databind.cfg.MapperBuilder<T, ?> builder, MediaType supportedMediaType) Construct a new instance with the providedbuildercustomized with theJacksonModules found byMapperBuilder.findModules(ClassLoader)andMediaType.protectedAbstractJacksonHttpMessageConverter(tools.jackson.databind.cfg.MapperBuilder<T, ?> builder, MediaType... supportedMediaTypes) Construct a new instance with the providedbuildercustomized with theJacksonModules found byMapperBuilder.findModules(ClassLoader)andMediaTypes.protectedAbstractJacksonHttpMessageConverter(T mapper, MediaType supportedMediaType) Construct a new instance with the providedObjectMapperandMediaType.protectedAbstractJacksonHttpMessageConverter(T mapper, MediaType... supportedMediaTypes) Construct a new instance with the providedObjectMapperandMediaTypes.protectedAbstractKotlinSerializationHttpMessageConverter(T format, Predicate<ResolvableType> typePredicate, MediaType... supportedMediaTypes) Creates a new instance with the given format and supported mime types which only converts types for which the specified predicate returnstrue.protectedAbstractKotlinSerializationHttpMessageConverter(T format, MediaType... supportedMediaTypes) Creates a new instance with the given format and supported mime types which only converters types annotated with@Serializableat type or generics level.protectedAbstractSmartHttpMessageConverter(MediaType supportedMediaType) Construct anAbstractSmartHttpMessageConverterwith one supported media type.protectedAbstractSmartHttpMessageConverter(MediaType... supportedMediaTypes) Construct anAbstractSmartHttpMessageConverterwith multiple supported media type.protectedKotlinSerializationBinaryHttpMessageConverter(T format, Predicate<ResolvableType> typePredicate, MediaType... supportedMediaTypes) Creates a new instance with the given format and supported mime types which only converts types for which the specified predicate returnstrue.protectedKotlinSerializationBinaryHttpMessageConverter(T format, MediaType... supportedMediaTypes) Creates a new instance with the given format and supported mime types which only converters types annotated with@Serializableat type or generics level.protectedKotlinSerializationStringHttpMessageConverter(T format, Predicate<ResolvableType> typePredicate, MediaType... supportedMediaTypes) Creates a new instance with the given format and supported mime types which only converts types for which the specified predicate returnstrue.protectedKotlinSerializationStringHttpMessageConverter(T format, MediaType... supportedMediaTypes) Creates a new instance with the given format and supported mime types which only converters types annotated with@Serializableat type or generics level. -
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 TypeMethodDescriptionAbstractJackson2HttpMessageConverter.getDefaultContentType(Object object) Deprecated, for removal: This API element is subject to removal in a future version.Methods in org.springframework.http.converter.json that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionAbstractJackson2HttpMessageConverter.getMediaTypesForProblemDetail()Deprecated, for removal: This API element is subject to removal in a future version.Return the supported media type(s) forProblemDetail.JacksonJsonHttpMessageConverter.getMediaTypesForProblemDetail()MappingJackson2HttpMessageConverter.getMediaTypesForProblemDetail()Deprecated, for removal: This API element is subject to removal in a future version.AbstractJackson2HttpMessageConverter.getObjectMappersForType(Class<?> clazz) Deprecated, for removal: This API element is subject to removal in a future version.Return ObjectMapper registrations for the given class, if any.AbstractJackson2HttpMessageConverter.getSupportedMediaTypes(Class<?> clazz) Deprecated, for removal: This API element is subject to removal in a future version.Methods in org.springframework.http.converter.json with parameters of type MediaTypeModifier and TypeMethodDescriptionbooleanDeprecated, for removal: This API element is subject to removal in a future version.booleanAbstractJackson2HttpMessageConverter.canRead(Type type, @Nullable Class<?> contextClass, @Nullable MediaType mediaType) Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.protected com.fasterxml.jackson.databind.ObjectWriterAbstractJackson2HttpMessageConverter.customizeWriter(com.fasterxml.jackson.databind.ObjectWriter writer, @Nullable com.fasterxml.jackson.databind.JavaType javaType, @Nullable MediaType contentType) Deprecated, for removal: This API element is subject to removal in a future version.Subclasses can use this method to customizeObjectWriterused for writing values.protected CharsetAbstractJackson2HttpMessageConverter.getCharset(@Nullable MediaType contentType) Deprecated, for removal: This API element is subject to removal in a future version.Determine the charset to use for JSON input.AbstractJackson2HttpMessageConverter.getContentLength(Object object, @Nullable MediaType contentType) Deprecated, for removal: This API element is subject to removal in a future version.protected com.fasterxml.jackson.core.JsonEncodingAbstractJackson2HttpMessageConverter.getJsonEncoding(@Nullable MediaType contentType) Deprecated, for removal: This API element is subject to removal in a future version.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, com.fasterxml.jackson.databind.ObjectMapper>> registrar) Deprecated, for removal: This API element is subject to removal in a future version.Configure theObjectMapperinstances to use for the givenClass.voidAbstractJackson2HttpMessageConverter.setSupportedMediaTypes(List<MediaType> supportedMediaTypes) Deprecated, for removal: This API element is subject to removal in a future version.Constructors in org.springframework.http.converter.json with parameters of type MediaTypeModifierConstructorDescriptionprotectedAbstractJackson2HttpMessageConverter(com.fasterxml.jackson.databind.ObjectMapper objectMapper, MediaType supportedMediaType) Deprecated, for removal: This API element is subject to removal in a future version.protectedAbstractJackson2HttpMessageConverter(com.fasterxml.jackson.databind.ObjectMapper objectMapper, MediaType... supportedMediaTypes) Deprecated, for removal: This API element is subject to removal in a future version. -
Uses of MediaType in org.springframework.http.converter.protobuf
Fields in org.springframework.http.converter.protobuf declared as MediaTypeModifier and TypeFieldDescriptionstatic final MediaTypeProtobufHttpMessageConverter.PLUS_PROTOBUFThe media-type for protobufapplication/*+x-protobuf.static 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) ProtobufHttpMessageConverter.ProtobufFormatDelegate.supportedMediaTypes()Return the supported media types for the converter.Methods in org.springframework.http.converter.protobuf with parameters of type MediaTypeModifier and TypeMethodDescriptionprotected booleanvoidProtobufHttpMessageConverter.ProtobufFormatDelegate.merge(HttpInputMessage inputMessage, MediaType contentType, Charset charset, com.google.protobuf.Message.Builder builder, com.google.protobuf.ExtensionRegistry extensionRegistry) Use merge methods onMessage.Builderto read a message from the givenHttpInputMessage.voidProtobufHttpMessageConverter.ProtobufFormatDelegate.print(com.google.protobuf.Message message, HttpOutputMessage outputMessage, MediaType contentType, Charset charset) Use print methods onMessage.Builderto write the message to the givenHttpOutputMessage.booleanProtobufHttpMessageConverter.ProtobufFormatDelegate.supportsWriteOnly(@Nullable MediaType mediaType) Whether the media type is supported for writing. -
Uses of MediaType in org.springframework.http.converter.xml
Methods in org.springframework.http.converter.xml that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionJacksonXmlHttpMessageConverter.getMediaTypesForProblemDetail()MappingJackson2XmlHttpMessageConverter.getMediaTypesForProblemDetail()Deprecated, for removal: This API element is subject to removal in a future version.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.booleanJaxb2CollectionHttpMessageConverter.canRead(Type type, @Nullable Class<?> contextClass, @Nullable MediaType mediaType) Indicates whether the given type can be read by this converter.booleanbooleanbooleanAlways returnsfalsesince Jaxb2CollectionHttpMessageConverter does not convert collections to XML.booleanJaxb2CollectionHttpMessageConverter.canWrite(@Nullable Type type, @Nullable Class<?> clazz, @Nullable MediaType mediaType) Always returnsfalsesince Jaxb2CollectionHttpMessageConverter does not convert collections to XML.booleanbooleanSourceHttpMessageConverter.getContentLength(T t, @Nullable MediaType contentType) voidJaxb2CollectionHttpMessageConverter.write(T t, @Nullable Type type, @Nullable 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).Constructors in org.springframework.mock.web with parameters of type MediaType -
Uses of MediaType in org.springframework.test.http
Subclasses with type arguments of type MediaType in org.springframework.test.httpMethods in org.springframework.test.http with parameters of type MediaTypeModifier and TypeMethodDescription<T> THttpMessageContentConverter.convert(HttpInputMessage message, MediaType mediaType, ResolvableType targetType) Deprecated, for removal: This API element is subject to removal in a future version.Convert the givenHttpInputMessagewhose content must match the givenMediaTypeto the requestedtargetType.MediaTypeAssert.isCompatibleWith(MediaType mediaType) Verify that the actual media type is compatible with the given one.Constructors in org.springframework.test.http with parameters of type MediaType -
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 byMediaType.isCompatibleWith(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, @Nullable MediaType contentType) ResponseCreatorfor a 200 response (OK) with byte[] body.static DefaultResponseCreatorMockRestResponseCreators.withSuccess(String body, @Nullable MediaType contentType) ResponseCreatorfor a 200 response (OK) with String body.static DefaultResponseCreatorMockRestResponseCreators.withSuccess(Resource body, @Nullable 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.WebTestClient.RequestBodySpec.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader. -
Uses of MediaType in org.springframework.test.web.reactive.server.assertj
Methods in org.springframework.test.web.reactive.server.assertj with parameters of type MediaTypeModifier and TypeMethodDescriptionWebTestClientResponseAssert.hasContentType(MediaType contentType) Verify that the response'sContent-Typeis equal to the given value.WebTestClientResponseAssert.hasContentTypeCompatibleWith(MediaType contentType) Verify that the response'sContent-Typeis compatible with the given value. -
Uses of MediaType in org.springframework.test.web.servlet.assertj
Methods in org.springframework.test.web.servlet.assertj with parameters of type MediaTypeModifier and TypeMethodDescriptionAbstractHttpServletResponseAssert.hasContentType(MediaType contentType) Verify that the response'sContent-Typeis equal to the given value.AbstractHttpServletResponseAssert.hasContentTypeCompatibleWith(MediaType contentType) Verify that the response'sContent-Typeis compatible with the given value. -
Uses of MediaType in org.springframework.test.web.servlet.client
Methods in org.springframework.test.web.servlet.client with parameters of type MediaTypeModifier and TypeMethodDescriptionSet the list of acceptable media types, as specified by theAcceptheader.RestTestClient.RequestBodySpec.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader. -
Uses of MediaType in org.springframework.test.web.servlet.client.assertj
Methods in org.springframework.test.web.servlet.client.assertj with parameters of type MediaTypeModifier and TypeMethodDescriptionRestTestClientResponseAssert.hasContentType(MediaType contentType) Verify that the response'sContent-Typeis equal to the given value.RestTestClientResponseAssert.hasContentTypeCompatibleWith(MediaType contentType) Verify that the response'sContent-Typeis 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 MediaType -
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 byMediaType.isCompatibleWith(MediaType). -
Uses of MediaType in org.springframework.test.web.support
Methods in org.springframework.test.web.support with parameters of type MediaTypeModifier and TypeMethodDescriptionAbstractHeaderAssertions.contentType(MediaType mediaType) Expect a "Content-Type" header with the given value.AbstractHeaderAssertions.contentTypeCompatibleWith(MediaType mediaType) Expect a "Content-Type" header compatible with the given value. -
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(@Nullable MediaType contentType, List<MediaType> mediaTypes) Create a new HttpMediaTypeNotSupportedException.HttpMediaTypeNotSupportedException(@Nullable MediaType contentType, List<MediaType> mediaTypes, @Nullable HttpMethod httpMethod) Create a new HttpMediaTypeNotSupportedException.HttpMediaTypeNotSupportedException(@Nullable MediaType contentType, List<MediaType> supportedMediaTypes, @Nullable HttpMethod httpMethod, String message) Create a new HttpMediaTypeNotSupportedException.Constructor parameters in org.springframework.web with type arguments of type MediaTypeModifierConstructorDescriptionprotectedHttpMediaTypeException(@Nullable String message, List<MediaType> supportedMediaTypes, @Nullable String messageDetailCode, Object @Nullable [] messageDetailArguments) Create a new HttpMediaTypeException with a list of supported media types.HttpMediaTypeNotAcceptableException(List<MediaType> mediaTypes) Create a new HttpMediaTypeNotSupportedException.HttpMediaTypeNotSupportedException(@Nullable String message, List<MediaType> mediaTypes) Create a new HttpMediaTypeNotSupportedException for a parse error.HttpMediaTypeNotSupportedException(@Nullable MediaType contentType, List<MediaType> mediaTypes) Create a new HttpMediaTypeNotSupportedException.HttpMediaTypeNotSupportedException(@Nullable MediaType contentType, List<MediaType> mediaTypes, @Nullable HttpMethod httpMethod) Create a new HttpMediaTypeNotSupportedException.HttpMediaTypeNotSupportedException(@Nullable MediaType contentType, List<MediaType> supportedMediaTypes, @Nullable 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 withMediaType.ALLthat is returned fromContentNegotiationStrategy.resolveMediaTypes(NativeWebRequest)when no specific media types are requested.Methods in org.springframework.web.accept that return MediaTypeModifier and TypeMethodDescriptionAbstractMappingContentNegotiationStrategy.handleNoMatch(NativeWebRequest request, String key) Override to provide handling when a key is not resolved via.MappingMediaTypeFileExtensionResolver.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, @Nullable 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(Properties)for programmatic registrations.protected voidAbstractMappingContentNegotiationStrategy.handleMatch(String key, MediaType mediaType) Override to provide handling when a key is successfully resolved viaMappingMediaTypeFileExtensionResolver.lookupMediaType(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.StandardApiVersionDeprecationHandler.VersionSpec.setDeprecationLink(URI uri, MediaType mediaType) Variation ofStandardApiVersionDeprecationHandler.VersionSpec.setDeprecationLink(URI)for use with a media type other than "text/html".StandardApiVersionDeprecationHandler.VersionSpec.setSunsetLink(URI uri, MediaType mediaType) Variation ofStandardApiVersionDeprecationHandler.VersionSpec.setSunsetLink(URI)for use with a media type other than "text/html".Method parameters in org.springframework.web.accept with type arguments of type MediaTypeModifier and TypeMethodDescriptionvoidContentNegotiationManagerFactoryBean.addMediaTypes(@Nullable Map<String, MediaType> mediaTypes) An alternative toContentNegotiationManagerFactoryBean.setMediaTypes(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.MediaTypeParamApiVersionResolver(MediaType compatibleMediaType, String paramName) Create an instance.Constructor parameters in org.springframework.web.accept with type arguments of type MediaTypeModifierConstructorDescriptionAbstractMappingContentNegotiationStrategy(@Nullable 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(@Nullable 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. -
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 toMediaType.APPLICATION_OCTET_STREAM.UnknownContentTypeException.getContentType()Return the content type of the response, or "application/octet-stream".Methods in org.springframework.web.client with parameters of type MediaTypeModifier and TypeMethodDescriptionSet the list of acceptable media types, as specified by theAcceptheader.RestClient.RequestBodySpec.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader.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.UnknownContentTypeException(Type targetType, MediaType contentType, HttpStatusCode statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody) Construct a new instance of with the given response data. -
Uses of MediaType in org.springframework.web.method.annotation
Methods in org.springframework.web.method.annotation that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionExceptionHandlerMappingInfo.getProducibleTypes()Return the producible media types by this handler.Methods in org.springframework.web.method.annotation with parameters of type MediaTypeModifier and TypeMethodDescriptionExceptionHandlerMethodResolver.resolveExceptionMapping(Throwable exception, MediaType mediaType) ExceptionHandlerMethodResolver.resolveExceptionMappingByExceptionType(Class<? extends Throwable> exceptionType, MediaType mediaType) Find aMethodto handle the given exception type and media type. -
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 withMediaType.ALLthat is returned fromRequestedContentTypeResolver.resolveMediaTypes(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.StandardApiVersionDeprecationHandler.VersionSpec.setDeprecationLink(URI uri, MediaType mediaType) Variation ofStandardApiVersionDeprecationHandler.VersionSpec.setDeprecationLink(URI)for use with a media type other than "text/html".StandardApiVersionDeprecationHandler.VersionSpec.setSunsetLink(URI uri, MediaType mediaType) Variation ofStandardApiVersionDeprecationHandler.VersionSpec.setSunsetLink(URI)for use with a media type other than "text/html".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.MediaTypeParamApiVersionResolver(MediaType compatibleMediaType, String paramName) Create an instance.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
Methods in org.springframework.web.reactive.config with parameters of type MediaTypeModifier and TypeMethodDescriptionApiVersionConfigurer.useMediaTypeParameter(MediaType compatibleMediaType, String paramName) Add resolver to extract the version from a media type parameter found in the Accept or Content-Type headers.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(@Nullable MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported.UnsupportedMediaTypeException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable 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(@Nullable MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported.UnsupportedMediaTypeException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable 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, @Nullable 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 TypeMethodDescriptionHandlerResultHandlerSupport.selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier) Select the best media type for the current request through a content negotiation algorithm.HandlerResultHandlerSupport.selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier, List<MediaType> acceptableTypes) Variant ofHandlerResultHandlerSupport.selectMediaType(ServerWebExchange, Supplier)with a given list of requested (acceptable) media types.Method parameters in org.springframework.web.reactive.result with type arguments of type MediaTypeModifier and TypeMethodDescriptionHandlerResultHandlerSupport.selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier) Select the best media type for the current request through a content negotiation algorithm.HandlerResultHandlerSupport.selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier, List<MediaType> acceptableTypes) Variant ofHandlerResultHandlerSupport.selectMediaType(ServerWebExchange, Supplier)with a given list of requested (acceptable) media types.HandlerResultHandlerSupport.selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier, List<MediaType> acceptableTypes) Variant ofHandlerResultHandlerSupport.selectMediaType(ServerWebExchange, Supplier)with a given list of requested (acceptable) media types. -
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:"text/html;charset=UTF-8".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 TypeMethodDescriptionAbstractView.render(@Nullable Map<String, ?> model, @Nullable MediaType contentType, ServerWebExchange exchange) Prepare the model to render.HttpMessageWriterView.render(@Nullable Map<String, ?> model, @Nullable MediaType contentType, ServerWebExchange exchange) View.render(@Nullable Map<String, ?> model, @Nullable MediaType contentType, ServerWebExchange exchange) Render the view based on the givenHandlerResult.AbstractView.renderInternal(Map<String, Object> renderAttributes, @Nullable MediaType contentType, ServerWebExchange exchange) Subclasses must implement this method to actually render the view.RedirectView.renderInternal(Map<String, Object> model, @Nullable 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 TypeMethodDescriptionFreeMarkerView.renderInternal(Map<String, Object> renderAttributes, @Nullable 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 TypeMethodDescriptionScriptTemplateView.renderInternal(Map<String, Object> model, @Nullable 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(@Nullable MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported.UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable ResolvableType bodyType) Constructor for when trying to encode from or decode to a specific Java type.UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable ResolvableType bodyType, @Nullable HttpMethod method) Constructor for when trying to encode from or decode to a specific Java type.UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable 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(@Nullable String reason, List<MediaType> supportedTypes) Constructor for when the specified Content-Type is invalid.UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported.UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable ResolvableType bodyType) Constructor for when trying to encode from or decode to a specific Java type.UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable ResolvableType bodyType, @Nullable HttpMethod method) Constructor for when trying to encode from or decode to a specific Java type.UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable HttpMethod method) Constructor that provides the HTTP method. -
Uses of MediaType in org.springframework.web.service.invoker
Methods in org.springframework.web.service.invoker that return MediaTypeModifier and TypeMethodDescriptionHttpRequestValues.Builder.getContentType()HttpRequestValues.Metadata.getContentType()Return the content type, if set already.Methods in org.springframework.web.service.invoker that return types with arguments of type MediaTypeModifier and TypeMethodDescriptionHttpRequestValues.Builder.getAcceptMediaTypes()HttpRequestValues.Metadata.getAcceptMediaTypes()Return the acceptable media types, if set already.Methods in org.springframework.web.service.invoker with parameters of type MediaTypeModifier and TypeMethodDescriptionHttpRequestValues.Builder.setContentType(MediaType contentType) Set the media type for the requestContent-Typeheader.ReactiveHttpRequestValues.Builder.setContentType(MediaType contentType) Method parameters in org.springframework.web.service.invoker with type arguments of type MediaTypeModifier and TypeMethodDescriptionSet the media types for the requestAcceptheader. -
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.ApiVersionConfigurer.useMediaTypeParameter(MediaType compatibleMediaType, String paramName) Add resolver to extract the version from a media type parameter found in the Accept or Content-Type headers.Method parameters in org.springframework.web.servlet.config.annotation with type arguments of type MediaTypeModifier and TypeMethodDescriptionContentNegotiationConfigurer.mediaTypes(@Nullable Map<String, MediaType> mediaTypes) An alternative toContentNegotiationConfigurer.mediaType(String, MediaType).ContentNegotiationConfigurer.replaceMediaTypes(Map<String, MediaType> mediaTypes) Similar toContentNegotiationConfigurer.mediaType(String, 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.Write the given object to the response stream, without flushing. -
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(jakarta.servlet.http.HttpServletRequest request, Class<?> valueClass) Returns the media types that can be produced.AbstractMessageConverterMethodProcessor.getProducibleMediaTypes(jakarta.servlet.http.HttpServletRequest request, Class<?> valueClass, @Nullable 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 TypeMethodDescriptionAbstractMappingJacksonResponseBodyAdvice.beforeBodyWrite(@Nullable Object body, MethodParameter returnType, MediaType contentType, Class<? extends HttpMessageConverter<?>> converterType, ServerHttpRequest request, ServerHttpResponse response) KotlinResponseBodyAdvice.beforeBodyWrite(@Nullable Object body, MethodParameter returnType, MediaType selectedContentType, Class<? extends HttpMessageConverter<?>> selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) ResponseBodyAdvice.beforeBodyWrite(@Nullable 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.JsonViewResponseBodyAdvice.determineWriteHints(@Nullable Object body, MethodParameter returnType, MediaType selectedContentType, Class<? extends HttpMessageConverter<?>> selectedConverterType) KotlinResponseBodyAdvice.determineWriteHints(@Nullable Object body, MethodParameter returnType, MediaType selectedContentType, Class<? extends HttpMessageConverter<?>> selectedConverterType) ResponseBodyAdvice.determineWriteHints(@Nullable T body, MethodParameter returnType, MediaType selectedContentType, Class<? extends HttpMessageConverter<?>> selectedConverterType) Invoked to determine write hints if the converter is aSmartHttpMessageConverter.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 TypeMethodDescriptionResourceHttpRequestHandler.getMediaType(jakarta.servlet.http.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(jakarta.servlet.http.HttpServletResponse response, Resource resource, @Nullable 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(jakarta.servlet.http.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()