Bandit.HTTPRequest behaviour (Bandit v0.2.2) View Source

Defines behaviour to be implemented by HTTP Request handlers in addition to those defined by Plug.Conn.Adapter.

Link to this section Summary

Link to this section Types

Specs

payload() :: term()

Link to this section Callbacks

Specs

close(payload()) :: :ok

Specs

get_local_data(payload()) :: Plug.Conn.Adapter.peer_data()

Specs

keepalive?(payload()) :: boolean()

Specs

read_headers(payload()) ::
  {:ok, keyword(), String.t(), String.t(), payload()} | {:error, String.t()}

Specs

request(ThousandIsland.Socket.t(), binary() | list()) ::
  {:ok, module(), payload()}
Link to this callback

send_fallback_resp(payload, code)

View Source

Specs

send_fallback_resp(payload(), code :: pos_integer()) :: :ok