XCribe v0.5.0 Xcribe.ContentDecoder View Source

Used to decode requests content to an elixir collection (map, list, etc)

Currently only json is supported and the module Xcribe.JSON is used to decode given value.

Link to this section Summary

Functions

Decode value by the given content_type.

Link to this section Functions

Link to this function

decode!(value, content_type)

View Source

Decode value by the given content_type.

iex> ContentDecoder.decode!("{"key":"value"}", "application/json")
%{"key" => "value"}

An UnknownType excption is raised when given content_type is unknown.