flux v0.1.1 Flux.HTTP

Documentation for Flux.HTTP.

Link to this section Summary

Functions

A convenience shortcut to send_response/1 that allows the caller to provide a path to a file and some options. Uses the Flux.File module to read the file. For more information, see send_response/1

Builds and sends an http response from the provided conn. Returns {:ok, sent_body, conn} if successful or :error if not. To manipulate what response is sent, manipulate the response fields of the conn

Link to this section Functions

Link to this function init(parent_pid, ref, socket, transport, opts)
init(pid(), identifier(), pid(), atom(), keyword()) :: atom()
Link to this function send_file(conn, file, offset \\ 0, length \\ :all)
send_file(Flux.Conn.t(), Path.t(), non_neg_integer(), non_neg_integer() | :all) ::
  {:ok, nil, Flux.Conn.t()} | :error

A convenience shortcut to send_response/1 that allows the caller to provide a path to a file and some options. Uses the Flux.File module to read the file. For more information, see send_response/1.

Link to this function send_response(conn)
send_response(Flux.Conn.t()) :: {:ok, iodata(), Flux.Conn.t()} | :error

Builds and sends an http response from the provided conn. Returns {:ok, sent_body, conn} if successful or :error if not. To manipulate what response is sent, manipulate the response fields of the conn.