class Bezel::Plug::Parsers

include Bezel::Plug

Reads the request's body into its parameters (Conn#params, and Conn#body_params alone) by its Content-Type:

A body over max_body bytes is Bezel::PayloadTooLarge (413), one that does not parse (or is not UTF-8) Bezel::BadRequest (400). A body of another type is left unread when its media type matches one of pass ("*/*", the default, passes every type; "text/*" a family; "application/xml" one), and is Bezel::UnsupportedMediaType (415) otherwise. A request without a body, or without a Content-Type, is passed on as it is, and so is a JSON body that turns out empty (a chunked one).

src/plug/parsers.qz:17

Class methods

def self.new(*, parsers: Array[Symbol] = …, max_body: Int = …, pass: Array[String] = …) -> Bezel::Plug::Parsers

The plug, with the parsers named (:urlencoded, :json).

src/plug/parsers.qz:25

Methods

def call(conn: Bezel::Conn) -> Bezel::Conn

The connection changed by this plug.

from Bezel::Plug

src/plug/parsers.qz:36