raxx v0.8.0 Raxx.Response

HTTP responses from a Raxx application are encapsulated in a Raxx.Response struct.

The contents are itemised below:

statusThe HTTP status code for the response: 1xx, 2xx, 3xx, 4xx, 5xx
headersThe response headers as a map: %{"content-type" => ["text/plain"]}
bodyThe response body, by default an empty string.

Summary

Functions

client_error?(map)
expire_cookie(map, key)

Adds a cookie header to the response, that will expire the cookie with the given key.

NOTE: Will not expire session cookies.

header_lines(headers)
informational?(map)
ok(body \\ "", headers \\ [])
redirect?(map)
server_error?(map)
set_cookie(map, key, value, options \\ %{})

Adds a set cookie header to the response.

For options see Raxx.Cookie.Attributes

status_line(int)
success?(map)