Plug v1.8.3 API Reference

Modules

The plug specification.

This module is deprecated. To use Cowboy 1 With Plug please include plug_cowboy version 1.0 or above in your mix.exs file. It is recommended that you use the Plug.Cowboy module directly instead of Plug.Adapters.Cowboy.

This module is deprecated. To use Cowboy 2 With Plug please include plug_cowboy version 2.0 or above in your mix.exs file. It is recommended that you use the Plug.Cowboy module directly instead of Plug.Adapters.Cowboy2

Conveniences for building plugs.

Plug to protect from cross-site request forgery.

The Plug connection.

Specification of the connection adapter API implemented by webservers

Conveniences for encoding and decoding cookies.

Conveniences for decoding and encoding url encoded queries.

Conveniences for working with status codes.

A struct used as default on unfetched fields.

Utilities for working with connection data

A module (not a plug) for debugging in development.

A module to be used in your existing plugs in order to provide error handling.

A protocol that extends exceptions to be status-code aware.

Conveniences for generating HTML.

A Plug to convert HEAD requests to GET requests.

A plug for logging basic request information in the format

This plug overrides the request's POST method with the method defined in the _method request parameter.

A plug for parsing the request body.

Parses JSON request body.

Parses multipart request body.

Parses urlencoded request body.

A plug for generating a unique request id for each request.

A DSL to define a routing algorithm that works with Plug.

A plug to force SSL connections and enable HSTS.

A plug to handle session cookies and session stores.

Stores the session in a cookie.

Stores the session in an in-memory ETS table.

Specification for session stores.

A plug for serving static assets.

A plug to instrument the pipeline with :telemetry events.

Conveniences for testing plugs.

A server (a GenServer specifically) that manages uploaded files.

Exceptions

The request will not be processed due to a client error.

Error raised when CSRF token is invalid.

Error raised when non-XHR requests are used for Javascript responses.

Error raised when trying to modify or send an already sent response

Error raised when the cookie exceeds the maximum size of 4096 bytes.

Error raised when trying to send a header that has errors, for example

Raised when the request string is malformed, for example

Error raised when no response is sent in a request

Wraps the connection in an error which is meant to be handled upper in the stack.

Raised when the request body contains bad encoding.

Error raised when the request body is malformed.

Error raised when the request is too large.

Error raised when the request body cannot be parsed.

Timeout while waiting for the request.