cauldron v0.1.9 Cauldron.Response protocol

Summary

Functions

Send the passed binary as body

Send the HTTP headers

Send a chunk

Send the HTTP status

Stream a file or an IO device

Stream a response body with a generator function

Types

t()
t() :: term

Functions

body(self, body)
body(t, iolist) :: t

Send the passed binary as body.

headers(self, headers)
headers(t, HTTProt.Headers.t) :: t

Send the HTTP headers.

send(self, chunk)

Send a chunk.

status(self, code)
status(t, integer | {integer, String.t}) :: t

Send the HTTP status.

stream(self, string_or_io)
stream(t, String.t | :io.device) :: t

Stream a file or an IO device.

stream(self, acc, fun)
stream(t, term, (term -> {iolist, term})) :: t

Stream a response body with a generator function.