Conduit v0.12.10 Conduit.ContentType.JSON View Source

Handles converting to and from JSON.

Link to this section Summary

Functions

Formats the body to json

Parses the body from json

Link to this section Functions

Formats the body to json.

Examples

iex> import Conduit.Message
iex> message =
iex>   %Conduit.Message{}
iex>   |> put_body(%{})
iex>   |> Conduit.ContentType.JSON.format([])
iex> message.body
"{}"

Parses the body from json.

Examples

iex> import Conduit.Message
iex> message =
iex>   %Conduit.Message{}
iex>   |> put_body("{}")
iex>   |> Conduit.ContentType.JSON.parse([])
iex> message.body
%{}