PaperTiger.Plugs.GetFormBody (PaperTiger v1.0.2)

Copy Markdown View Source

Parses form-encoded body params for GET requests.

Plug.Parsers only parses request bodies for POST/PUT/PATCH/DELETE. Some HTTP clients (e.g. Stripe SDK wrappers using Req with form: option) send form-encoded params in the body even for GET requests. This plug reads the body and sets body_params so that Plug.Parsers merges them with query params correctly.

Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Functions

call(conn, opts)

Callback implementation for Plug.call/2.

init(opts)

Callback implementation for Plug.init/1.