Maxwell.Middleware.DecodeJson (maxwell v2.4.0) View Source

Decode response's body to json when

  1. The reponse headers contain a content type of application/json and body is binary.
  2. The response is a list

Default json decoder is Poison

Examples

  # Client.ex
  use Maxwell.Builder ~(get)a
  middleware Maxwell.Middleware.DecodeJson

  # OR

  middleware Maxwell.Middleware.DecodeJson,
    decode_content_types: ["text/javascript"],
    decode_func: &other_json_lib.decode/1