类 FormHttpMessageReader
- java.lang.Object
- org.springframework.http.codec.LoggingCodecSupport
- org.springframework.http.codec.FormHttpMessageReader
- 所有已实现的接口:
HttpMessageReader<MultiValueMap<String,String>>
public class FormHttpMessageReader extends LoggingCodecSupport implements HttpMessageReader<MultiValueMap<String,String>>
Implementation of anHttpMessageReader
to read HTML form data, i.e. request body with media type"application/x-www-form-urlencoded"
.- 从以下版本开始:
- 5.0
- 作者:
- Sebastien Deleuze, Rossen Stoyanchev
字段概要
字段 修饰符和类型 字段 说明 static Charset
DEFAULT_CHARSET
The default charset used by the reader.从类继承的字段 org.springframework.http.codec.LoggingCodecSupport
logger
构造器概要
构造器 构造器 说明 FormHttpMessageReader()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
canRead(ResolvableType elementType, MediaType mediaType)
Whether the given object type is supported by this reader.Charset
getDefaultCharset()
Return the configured default charset.int
getMaxInMemorySize()
Return theconfigured
byte count limit.List<MediaType>
getReadableMediaTypes()
Return theMediaType
's that this reader supports.reactor.core.publisher.Flux<MultiValueMap<String,String>>
read(ResolvableType elementType, ReactiveHttpInputMessage message, Map<String,Object> hints)
Read from the input message and encode to a stream of objects.reactor.core.publisher.Mono<MultiValueMap<String,String>>
readMono(ResolvableType elementType, ReactiveHttpInputMessage message, Map<String,Object> hints)
Read from the input message and encode to a single object.void
setDefaultCharset(Charset charset)
Set the default character set to use for reading form data when the request Content-Type header does not explicitly specify it.void
setMaxInMemorySize(int byteCount)
Set the max number of bytes for input form data.从类继承的方法 org.springframework.http.codec.LoggingCodecSupport
isEnableLoggingRequestDetails, setEnableLoggingRequestDetails
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.http.codec.HttpMessageReader
read, readMono
字段详细资料
DEFAULT_CHARSET
public static final Charset DEFAULT_CHARSET
The default charset used by the reader.
构造器详细资料
FormHttpMessageReader
public FormHttpMessageReader()
方法详细资料
setDefaultCharset
public void setDefaultCharset(Charset charset)
Set the default character set to use for reading form data when the request Content-Type header does not explicitly specify it.By default this is set to "UTF-8".
getDefaultCharset
public Charset getDefaultCharset()
Return the configured default charset.
setMaxInMemorySize
public void setMaxInMemorySize(int byteCount)
Set the max number of bytes for input form data. As form data is buffered before it is parsed, this helps to limit the amount of buffering. Once the limit is exceeded,DataBufferLimitException
is raised.By default this is set to 256K.
- 参数:
byteCount
- the max number of bytes to buffer, or -1 for unlimited- 从以下版本开始:
- 5.1.11
getMaxInMemorySize
public int getMaxInMemorySize()
Return theconfigured
byte count limit.- 从以下版本开始:
- 5.1.11
canRead
public boolean canRead(ResolvableType elementType, @Nullable MediaType mediaType)
从接口复制的说明:HttpMessageReader
Whether the given object type is supported by this reader.- 指定者:
canRead
在接口中HttpMessageReader<MultiValueMap<String,String>>
- 参数:
elementType
- the type of object to checkmediaType
- the media type for the read (possiblynull
)- 返回:
true
if readable,false
otherwise
read
public reactor.core.publisher.Flux<MultiValueMap<String,String>> read(ResolvableType elementType, ReactiveHttpInputMessage message, Map<String,Object> hints)
从接口复制的说明:HttpMessageReader
Read from the input message and encode to a stream of objects.- 指定者:
read
在接口中HttpMessageReader<MultiValueMap<String,String>>
- 参数:
elementType
- the type of objects in the stream which must have been previously checked viaHttpMessageReader.canRead(ResolvableType, MediaType)
message
- the message to read fromhints
- additional information about how to read and decode the input- 返回:
- the decoded stream of elements
readMono
public reactor.core.publisher.Mono<MultiValueMap<String,String>> readMono(ResolvableType elementType, ReactiveHttpInputMessage message, Map<String,Object> hints)
从接口复制的说明:HttpMessageReader
Read from the input message and encode to a single object.- 指定者:
readMono
在接口中HttpMessageReader<MultiValueMap<String,String>>
- 参数:
elementType
- the type of objects in the stream which must have been previously checked viaHttpMessageReader.canRead(ResolvableType, MediaType)
message
- the message to read fromhints
- additional information about how to read and decode the input- 返回:
- the decoded object
getReadableMediaTypes
public List<MediaType> getReadableMediaTypes()
从接口复制的说明:HttpMessageReader
Return theMediaType
's that this reader supports.- 指定者:
getReadableMediaTypes
在接口中HttpMessageReader<MultiValueMap<String,String>>