Oasis.CacheRawBodyReader (oasis v0.7.0)

Copy Markdown View Source

A Plug.Parsers body reader that preserves the raw request body.

Oasis uses the cached bytes to distinguish Plug's _json wrapper for a primitive JSON root from a literal JSON object whose property is named _json. Generated routers configure this reader automatically. Handwritten pipelines that validate primitive JSON request bodies should pass {Oasis.CacheRawBodyReader, :read_body, []} as Plug.Parsers's :body_reader option.

Summary

Functions

read_body(conn, opts)