Conduit v0.1.1 Conduit.Plug.Decode
Decodes the message body based on the content encoding.
It uses in order of preference:
- The content encoding specified for the plug.
- The content encoding specified on the message.
- The default content encoding
identity
.
This plug should be used in an incoming pipeline. Generally before
a Conduit.Plug.Parse
plug.
plug Conduit.Plug.Decode
plug Conduit.Plug.Decode, content_encoding: "gzip"
Summary
Functions
Formats the message body based on the content encoding
Callback implementation for Conduit.Plug.init/1
Functions
Formats the message body based on the content encoding.
Examples
iex> import Conduit.Message
iex> message =
iex> %Conduit.Message{}
iex> |> put_body("{}")
iex> |> Conduit.Plug.Decode.call([])
iex> message.body
"{}"
iex> get_meta(message, :content_encoding)
"identity"
Callback implementation for Conduit.Plug.init/1
.