类 FormHttpMessageReader
java.lang.Object
cn.taketoday.http.codec.LoggingCodecSupport
cn.taketoday.http.codec.FormHttpMessageReader
- 所有已实现的接口:
HttpMessageReader<cn.taketoday.util.MultiValueMap<String,String>>
public class FormHttpMessageReader
extends LoggingCodecSupport
implements HttpMessageReader<cn.taketoday.util.MultiValueMap<String,String>>
Implementation of an
HttpMessageReader to read HTML form data, i.e.
request body with media type "application/x-www-form-urlencoded".- 从以下版本开始:
- 4.0
- 作者:
- Sebastien Deleuze, Rossen Stoyanchev
-
字段概要
字段修饰符和类型字段说明static final CharsetThe default charset used by the reader.private Charsetprivate intprivate static final cn.taketoday.core.ResolvableType从类继承的字段 cn.taketoday.http.codec.LoggingCodecSupport
logger -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanWhether the given object type is supported by this reader.Return the configured default charset.intReturn theconfiguredbyte count limit.private CharsetgetMediaTypeCharset(MediaType mediaType) Return the list of media types supported by this reader.private voidparseFormData(Charset charset, String body) read(cn.taketoday.core.ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) Read from the input message and decode to a stream of objects.readMono(cn.taketoday.core.ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) Read from the input message and decode to a single object.voidsetDefaultCharset(Charset charset) Set the default character set to use for reading form data when the request Content-Type header does not explicitly specify it.voidsetMaxInMemorySize(int byteCount) Set the max number of bytes for input form data.从类继承的方法 cn.taketoday.http.codec.LoggingCodecSupport
isEnableLoggingRequestDetails, setEnableLoggingRequestDetails从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.http.codec.HttpMessageReader
getReadableMediaTypes, read, readMono
-
字段详细资料
-
DEFAULT_CHARSET
The default charset used by the reader. -
MULTIVALUE_STRINGS_TYPE
private static final cn.taketoday.core.ResolvableType MULTIVALUE_STRINGS_TYPE -
defaultCharset
-
maxInMemorySize
private int maxInMemorySize
-
-
构造器详细资料
-
FormHttpMessageReader
public FormHttpMessageReader()
-
-
方法详细资料
-
setDefaultCharset
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
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,DataBufferLimitExceptionis raised.By default this is set to 256K.
- 参数:
byteCount- the max number of bytes to buffer, or -1 for unlimited
-
getMaxInMemorySize
public int getMaxInMemorySize()Return theconfiguredbyte count limit. -
canRead
从接口复制的说明:HttpMessageReaderWhether the given object type is supported by this reader.- 指定者:
canRead在接口中HttpMessageReader<cn.taketoday.util.MultiValueMap<String,String>> - 参数:
elementType- the type of object to checkmediaType- the media type for the read (possiblynull)- 返回:
trueif readable,falseotherwise
-
read
public reactor.core.publisher.Flux<cn.taketoday.util.MultiValueMap<String,String>> read(cn.taketoday.core.ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) 从接口复制的说明:HttpMessageReaderRead from the input message and decode to a stream of objects.- 指定者:
read在接口中HttpMessageReader<cn.taketoday.util.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<cn.taketoday.util.MultiValueMap<String,String>> readMono(cn.taketoday.core.ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) 从接口复制的说明:HttpMessageReaderRead from the input message and decode to a single object.- 指定者:
readMono在接口中HttpMessageReader<cn.taketoday.util.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
-
logFormData
-
getMediaTypeCharset
-
parseFormData
-
getReadableMediaTypes
从接口复制的说明:HttpMessageReaderReturn the list of media types supported by this reader. The list may not apply to every possible target element type and calls to this method should typically be guarded viacanWrite(elementType, null). The list may also exclude media types supported only for a specific element type. Alternatively, useHttpMessageReader.getReadableMediaTypes(ResolvableType)for a more precise list.- 指定者:
getReadableMediaTypes在接口中HttpMessageReader<cn.taketoday.util.MultiValueMap<String,String>> - 返回:
- the general list of supported media types
-