public class FormHttpMessageWriter extends Object implements HttpMessageWriter<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(ResolvableType elementType,
MediaType mediaType)
Whether the given object type is supported by this writer.
|
Charset |
getDefaultCharset()
Return the configured default charset.
|
List<MediaType> |
getWritableMediaTypes()
Return the
MediaType 's that this writer supports. |
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 MultiValueMap<String,String>> inputStream,
ResolvableType elementType,
MediaType mediaType,
ReactiveHttpOutputMessage message,
Map<String,Object> hints)
Write an given stream of object to the output message.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
write
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(ResolvableType elementType, @Nullable MediaType mediaType)
HttpMessageWriter
canWrite
in interface HttpMessageWriter<MultiValueMap<String,String>>
elementType
- the type of object to checkmediaType
- the media type for the write, possibly null
true
if writable, false
otherwisepublic reactor.core.publisher.Mono<Void> write(org.reactivestreams.Publisher<? extends MultiValueMap<String,String>> inputStream, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage message, Map<String,Object> hints)
HttpMessageWriter
write
in interface HttpMessageWriter<MultiValueMap<String,String>>
inputStream
- the objects to writeelementType
- the type of objects in the stream which must have been
previously checked via HttpMessageWriter.canWrite(ResolvableType, MediaType)
mediaType
- the content type for the write, possibly null
to
indicate that the default content type of the writer must be used.message
- the message to write tohints
- additional information about how to encode and writepublic List<MediaType> getWritableMediaTypes()
HttpMessageWriter
MediaType
's that this writer supports.getWritableMediaTypes
in interface HttpMessageWriter<MultiValueMap<String,String>>