Encode Array[Byte]
binary data.
Encode ByteBuffer
binary data.
Default text encoder, using 16KB
chunks.
Default text encoder, using UTF-8
as charset.
Encode Unit
values as an empty content.
Create a content encoder for java.io.File
.
Create a content encoder for java.io.File
.
the size of chunks that will be produced in the content stream. Default to 16KB
.
an encoder for java.io.File
.
Pass-through encoder for Content values.
Create a content encoder for java blocking java.io.InputStream
.
Create a content encoder for java blocking java.io.InputStream
.
Note that the inputStream is read lazily and is not buffered in memory. Therefore the content length is not known and no corresponding HTTP header is produced.
the size of chunks that will be produced in the content stream. Default to 16KB
.
an encoder for java.io.InputStream
.
Create text content encoder using the provided charset.
Create text content encoder using the provided charset.
the codec to use to code the string as binary.
an encoder for java.lang.Charsequence
.
Encode url-encoded-form-data
from a Map[String,Seq[String]]
value.
Encode url-encoded-form-data
from a Map[String,Seq[String]]
value.
See https://www.w3.org/TR/html5/forms.html#url-encoded-form-data.
(Since version ) see corresponding Javadoc for more information.
Library of built-in content encoders.
This provides content encoder functions for the common scala types, and implicit encoder configured with a set of sensible default.
The implicitly provided encoders are chosen by the compiler and cannot be explicitly configured.
For example, this code:
will generate an HTTP response body by encoding the provided string using the UTF-8 charset.
If you want to configure the content encoder, you can just pass it yourself instead of relying on implicit resolution: