public class FormHttpMessageWriter extends Object implements HttpMessageWriter<org.springframework.util.MultiValueMap<String,String>>
HttpMessageWriter to write HTML form data, i.e.
response body with media type "application/x-www-form-urlencoded".| Modifier and Type | Field and Description |
|---|---|
static Charset |
DEFAULT_CHARSET |
| Constructor and Description |
|---|
FormHttpMessageWriter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canWrite(org.springframework.core.ResolvableType elementType,
MediaType mediaType)
Indicates whether the given class can be written by this converter.
|
Charset |
getDefaultCharset()
Return the configured default charset.
|
List<MediaType> |
getWritableMediaTypes()
Return the list of
MediaType objects that can be written by this converter. |
void |
setDefaultCharset(Charset charset)
Set the default character set to use for writing form data when the response
Content-Type header does not explicitly specify it.
|
reactor.core.publisher.Mono<Void> |
write(org.reactivestreams.Publisher<? extends org.springframework.util.MultiValueMap<String,String>> inputStream,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ReactiveHttpOutputMessage outputMessage,
Map<String,Object> hints)
Write an given object to the given output message.
|
public static final Charset DEFAULT_CHARSET
public void setDefaultCharset(Charset charset)
By default this is set to "UTF-8".
public Charset getDefaultCharset()
public boolean canWrite(org.springframework.core.ResolvableType elementType,
MediaType mediaType)
HttpMessageWritercanWrite in interface HttpMessageWriter<org.springframework.util.MultiValueMap<String,String>>elementType - the stream element type to test for writabilitymediaType - the media type to write, can be null if not specified.
Typically the value of an Accept header.true if writable; false otherwisepublic reactor.core.publisher.Mono<Void> write(org.reactivestreams.Publisher<? extends org.springframework.util.MultiValueMap<String,String>> inputStream, org.springframework.core.ResolvableType elementType, MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String,Object> hints)
HttpMessageWriterwrite in interface HttpMessageWriter<org.springframework.util.MultiValueMap<String,String>>inputStream - the input stream to writeelementType - the stream element type to process. This type must have previously
been passed to the HttpMessageWriter.canWrite(org.springframework.core.ResolvableType, org.springframework.http.MediaType) canWrite} method of this interface, which must
have returned true.mediaType - the content type to use when writing, typically the value of an
Accept header. May be null to indicate that the default content
type of the converter must be used.outputMessage - the message to write tohints - additional information about how to writeMono that indicates completion or errorpublic List<MediaType> getWritableMediaTypes()
HttpMessageWriterMediaType objects that can be written by this converter.getWritableMediaTypes in interface HttpMessageWriter<org.springframework.util.MultiValueMap<String,String>>