Msgpax v2.1.1 Msgpax.PlugParser View Source

A Plug.Parsers plug for parsing a MessagePack-encoded body.

Look at the documentation for Plug.Parsers for more information on how to use Plug.Parsers.

Examples

defmodule MyPlugPipeline do
  use Plug.Builder

  plug Plug.Parsers, parsers: [Msgpax.PlugParser], pass: ["application/msgpack"]
  # rest of the pipeline
end

Link to this section Summary

Functions

Attempts to parse the connection’s request body given the content-type type and subtype and the headers. Returns

Link to this section Functions

Link to this function parse(conn, arg2, arg3, headers, opts) View Source

Attempts to parse the connection’s request body given the content-type type and subtype and the headers. Returns:

  • {:ok, conn} if the parser is able to handle the given content-type
  • {:next, conn} if the next parser should be invoked
  • {:error, :too_large, conn} if the request goes over the given limit

Callback implementation for Plug.Parsers.parse/5.