maxwell v1.0.1 Maxwell.Middleware.DecodeJson

Decode reponse's body to json when

  1. Reponse header contain {'Content-Type', "application/json"} and body is binary

  2. Reponse is list

Default json_lib is Poison ```ex

Client.ex

use Maxwell.Builder ~(get)a @middleware Maxwell.Middleware.DecodeJson

or

@middleware Maxwell.Middleware.DecodeJson, [validtypes: "text/javascript", decodefunc: &otherjsonlib.decode/1] ```

Summary

Functions

call(env, run, opts)
is_json_content(content_type, body, valid_types)