StringHttpMessageConverter spring-doc.cn
|
An HttpMessageConverter implementation that can read and write String instances from the HTTP request and response.
By default, this converter supports all text media types(text/* ) and writes with a Content-Type of text/plain .spring-doc.cn |
FormHttpMessageConverter spring-doc.cn
|
An HttpMessageConverter implementation that can read and write form data from the HTTP request and response.
By default, this converter reads and writes the application/x-www-form-urlencoded media type.
Form data is read from and written into a MultiValueMap<String, String> .
The converter can also write (but not read) multipart data read from a MultiValueMap<String, Object> .
By default, multipart/form-data is supported.
Additional multipart subtypes can be supported for writing form data.
Consult the javadoc for FormHttpMessageConverter for further details.spring-doc.cn |
ByteArrayHttpMessageConverter spring-doc.cn
|
An HttpMessageConverter implementation that can read and write byte arrays from the HTTP request and response.
By default, this converter supports all media types (*/* ) and writes with a Content-Type of application/octet-stream .
You can override this by setting the supportedMediaTypes property and overriding getContentType(byte[]) .spring-doc.cn |
MarshallingHttpMessageConverter spring-doc.cn
|
An HttpMessageConverter implementation that can read and write XML by using Spring’s Marshaller and Unmarshaller abstractions from the org.springframework.oxm package.
This converter requires a Marshaller and Unmarshaller before it can be used.
You can inject these through constructor or bean properties.
By default, this converter supports text/xml and application/xml .spring-doc.cn |
MappingJackson2HttpMessageConverter spring-doc.cn
|
An HttpMessageConverter implementation that can read and write JSON by using Jackson’s ObjectMapper .
You can customize JSON mapping as needed through the use of Jackson’s provided annotations.
When you need further control (for cases where custom JSON serializers/deserializers need to be provided for specific types), you can inject a custom ObjectMapper through the ObjectMapper property.
By default, this converter supports application/json . This requires the com.fasterxml.jackson.core:jackson-databind dependency.spring-doc.cn |
MappingJackson2XmlHttpMessageConverter spring-doc.cn
|
An HttpMessageConverter implementation that can read and write XML by using Jackson XML extension’s XmlMapper .
You can customize XML mapping as needed through the use of JAXB or Jackson’s provided annotations.
When you need further control (for cases where custom XML serializers/deserializers need to be provided for specific types), you can inject a custom XmlMapper through the ObjectMapper property.
By default, this converter supports application/xml . This requires the com.fasterxml.jackson.dataformat:jackson-dataformat-xml dependency.spring-doc.cn |
MappingJackson2CborHttpMessageConverter spring-doc.cn
|
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor spring-doc.cn
|
SourceHttpMessageConverter spring-doc.cn
|
An HttpMessageConverter implementation that can read and write javax.xml.transform.Source from the HTTP request and response.
Only DOMSource , SAXSource , and StreamSource are supported.
By default, this converter supports text/xml and application/xml .spring-doc.cn |
GsonHttpMessageConverter spring-doc.cn
|
An HttpMessageConverter implementation that can read and write JSON by using "Google Gson".
This requires the com.google.code.gson:gson dependency.spring-doc.cn |
JsonbHttpMessageConverter spring-doc.cn
|
An HttpMessageConverter implementation that can read and write JSON by using the Jakarta Json Bind API.
This requires the jakarta.json.bind:jakarta.json.bind-api dependency and an implementation available.spring-doc.cn |
ProtobufHttpMessageConverter spring-doc.cn
|
An HttpMessageConverter implementation that can read and write Protobuf messages in binary format with the "application/x-protobuf"
content type. This requires the com.google.protobuf:protobuf-java dependency.spring-doc.cn |
ProtobufJsonFormatHttpMessageConverter spring-doc.cn
|
An HttpMessageConverter implementation that can read and write JSON documents to and from Protobuf messages.
This requires the com.google.protobuf:protobuf-java-util dependency.spring-doc.cn |