Allows to send arbitrarily complex JSON data.
A body made of multiple parts.
A body containing raw binary data
A body containing raw binary data
Usage: Stream bodies are used to send arbitrary binary data such as
audio, video or any other file attachment.
The content-type can be overridden to something more specific like image/jpeg
or audio/wav
for instance.
It is common to embed a stream body in a MultiPartBody to send additional information
with the binary file.
When possible, send a Content-Length
header along with an octet-stream body. It may allow the receiver
end to better handle the loading.
A stream body is sent with the content-type application/octet-stream.
A simple UTF-8 encoded string body
An urlencoded HTTP body.
An urlencoded HTTP body.
Usage: urlencoded bodies are best suited for simple key/value maps of strings. For more structured data, use JSONBody. For binary data, use StreamBody or MultiPartBody.
URLEncoded bodies are associated with the mime type "application/x-www-form-urlencoded" and look like query string parameters (eg. key=value&key2=value2 ).
A body made of multiple parts.
Usage: A multipart body acts as a container for other bodies. For instance, the multipart body is commonly used to send a form with binary attachments in conjunction with the StreamBody. For simple key/value pairs, use URLEncodedBody instead.
Safety consideration: A random boundary is generated to separate parts. If the boundary was to occur within a body part, it would mess up the whole body. In practice, the odds are extremely small though.