raxx v0.10.1 Raxx.Response
HTTP responses from a Raxx application are encapsulated in a Raxx.Response
struct.
The contents are itemised below:
status | The HTTP status code for the response: 1xx, 2xx, 3xx, 4xx, 5xx |
headers | The response headers as a map: %{"content-type" => ["text/plain"]} |
body | The response body, by default an empty string. |
Examples
iex> Response.ok().status
200
iex> Response.ok("Hello, World!").body
"Hello, World!"
iex> Response.ok([{"content-language", "en"}]).headers
[{"content-language", "en"}]
iex> Response.ok("Hello, World!", [{"content-type", "text/plain"}]).headers
[{"content-type", "text/plain"}]
Summary
Functions
Create a “202 Accepted” response
Create a “502 Bad Gateway” response
Create a “400 Bad Request” response
The response indicates that the client sent an incorrect request
Create a “409 Conflict” response
Create a “100 Continue” response
Create a “201 Created” response
Create a “417 Expectation Failed” response
Create a “403 Forbidden” response
Create a “302 Found” response
Create a “504 Gateway Timeout” response
Create a “410 Gone” response
Create a “505 HTTP Version Not Supported” response
The response is marked as an interim response
Create a “500 Internal Server Error” response
Create a “411 Length Required” response
Create a “405 Method Not Allowed” response
Create a “301 Moved Permanently” response
Create a “300 Multiple Choices” response
Create a “204 No Content” response
Create a “203 Non-Authoritative Information” response
Create a “406 Not Acceptable” response
Create a “404 Not Found” response
Create a “501 Not Implemented” response
Create a “304 Not Modified” response
Create a “200 OK” response
Create a “206 Partial Content” response
Create a “413 Payload Too Large” response
Create a “402 Payment Required” response
Create a “412 Precondition Failed” response
Create a “407 Proxy Authentication Required” response
Create a “416 Range Not Satisfiable” response
The response indicates that further action needs to be taken by the client
Create a “408 Request Timeout” response
Create a “205 Reset Content” response
Create a “303 See Other” response
The response indicates that the server is incapable of acting upon the request
Create a “503 Service Unavailable” response
The response indicates that client request was received, understood, and accepted
Create a “101 Switching Protocols” response
Create a “307 Temporary Redirect” response
Create a “401 Unauthorized” response
Create a “415 Unsupported Media Type” response
Create a “426 Upgrade Required” response
Create a “414 URI Too Long” response
Create a “305 Use Proxy” response
Functions
Create a “202 Accepted” response.
See module documentation for adding response content
Create a “502 Bad Gateway” response.
See module documentation for adding response content
Create a “400 Bad Request” response.
See module documentation for adding response content
The response indicates that the client sent an incorrect request.
Create a “409 Conflict” response.
See module documentation for adding response content
Create a “100 Continue” response.
See module documentation for adding response content
Create a “201 Created” response.
See module documentation for adding response content
Create a “417 Expectation Failed” response.
See module documentation for adding response content
Create a “403 Forbidden” response.
See module documentation for adding response content
Create a “302 Found” response.
See module documentation for adding response content
Create a “504 Gateway Timeout” response.
See module documentation for adding response content
Create a “410 Gone” response.
See module documentation for adding response content
Create a “505 HTTP Version Not Supported” response.
See module documentation for adding response content
The response is marked as an interim response.
Create a “500 Internal Server Error” response.
See module documentation for adding response content
Create a “411 Length Required” response.
See module documentation for adding response content
Create a “405 Method Not Allowed” response.
See module documentation for adding response content
Create a “301 Moved Permanently” response.
See module documentation for adding response content
Create a “300 Multiple Choices” response.
See module documentation for adding response content
Create a “204 No Content” response.
See module documentation for adding response content
Create a “203 Non-Authoritative Information” response.
See module documentation for adding response content
Create a “406 Not Acceptable” response.
See module documentation for adding response content
Create a “404 Not Found” response.
See module documentation for adding response content
Create a “501 Not Implemented” response.
See module documentation for adding response content
Create a “304 Not Modified” response.
See module documentation for adding response content
Create a “200 OK” response.
See module documentation for adding response content
Create a “206 Partial Content” response.
See module documentation for adding response content
Create a “413 Payload Too Large” response.
See module documentation for adding response content
Create a “402 Payment Required” response.
See module documentation for adding response content
Create a “412 Precondition Failed” response.
See module documentation for adding response content
Create a “407 Proxy Authentication Required” response.
See module documentation for adding response content
Create a “416 Range Not Satisfiable” response.
See module documentation for adding response content
The response indicates that further action needs to be taken by the client.
Create a “408 Request Timeout” response.
See module documentation for adding response content
Create a “205 Reset Content” response.
See module documentation for adding response content
Create a “303 See Other” response.
See module documentation for adding response content
The response indicates that the server is incapable of acting upon the request.
The response indicates that client request was received, understood, and accepted.
Create a “101 Switching Protocols” response.
See module documentation for adding response content
Create a “307 Temporary Redirect” response.
See module documentation for adding response content
Create a “401 Unauthorized” response.
See module documentation for adding response content
Create a “415 Unsupported Media Type” response.
See module documentation for adding response content
Create a “426 Upgrade Required” response.
See module documentation for adding response content
Create a “414 URI Too Long” response.
See module documentation for adding response content