Default configuration for the maximum amount of bytes a decoder can read in memory.
Default configuration for the maximum amount of bytes a decoder can read in memory.
Default to 1MB
, and can be configured globally via lol.http.ContentDecoder.maxSizeInMemory
system property.
Create binary content decoders.
Create binary content decoders. They read the byte stream in memory and return them as an Array[Byte]
.
the maximum amount of bytes that can read in memory.
a content decoder for Array[Byte]
.
Default binary content decoder configured with maxSize
equals to MaxSize.
Default text content decoder configured with maxSize
equals to MaxSize and defaultCodec
to UTF-8.
Default url-encoded-form-data
decoder configured with maxSize
equals to MaxSize.
Default url-encoded-form-data
decoder for Map[String,String]
.
A content decoder that discard everything from the stream and returns Unit
.
Create text content decoders.
Create text content decoders. They read the byte stream in memory and return them as a String
.
The decoder looks for the charset to use in the Content-Type
HTTP header, or otherwise fallback to the
provided default codec.
the maximum amount of bytes that can read in memory.
the default codec to use to decode the bytes as text if not specified in the Content-Type
HTTP header.
a content decoder for Array[Byte]
.
Create content decoder for url-encoded-form-data
.
Create content decoder for url-encoded-form-data
. The content is converted to a Map[String,Seq[String]]
.
See https://www.w3.org/TR/html5/forms.html#url-encoded-form-data.
the maximum amount of bytes that can read in memory.
the codec to use to read the content (should be us-ascii as defined in the specification).
a content decoder for Map[String,Seq[String]]
.
Same as urlEncoded but keeps only one value per key, therefore producing a Map[String,String]
value.
(Since version ) see corresponding Javadoc for more information.
Library of built-in content decoders.
This provides content decoder functions for the common scala types, and implicit decoder configured with a set of sensible default.
The implicitly provided decoders are chosen by the compiler and cannot be explicitly configured. In particular they are automatically configured with a MaxSize limit that specify the maximum amount of bytes they are authorized to read in memory.
It means that for example, this code:
will truncate the content body if it is bigger than the MaxSize property. The default for MaxSize is
1MB
, and can be configured globally via thelol.http.ContentDecoder.maxSizeInMemory
system property.If you want to configure the content decoder to allow it to read more data despite the maximum set in MaxSize, you can just pass the content decoder yourself instead of relying on implicit resolution: