Dowser. Client. JSON. Adapter behaviour
(Dowser.Client v0.1.1)
View Source
Behaviour implemented by every JSON codec.
Adapters convert between Elixir terms and JSON. encode/2 returns iodata
(cheap to feed straight into a request body); decode/2 takes the raw
response binary. Both accept a keyword list of codec-specific options and
return a tagged tuple instead of raising, so the caller decides how to handle
failures.
Decoding yields string-keyed maps unless the underlying codec is told
otherwise through opts.
Bundled implementations:
Dowser.Client.JSON.Native— Elixir's built-inJSONmodule (no dependency)Dowser.Client.JSON.Jason— theJasonlibrary (optional dependency)Dowser.Client.JSON.Poison— thePoisonlibrary (optional dependency)
Summary
Types
@type opts() :: keyword()