raxx v0.7.1 Raxx.Request
HTTP requests to a Raxx application are encapsulated in a Raxx.Request
struct.
The contents are itemised below:
host | The location of the hosting server, as a binary. e.g. www.example.com . |
port | The connection port on the server, as an integer. |
method | The HTTP request method, such as “GET” or “POST”, as a binary. This cannot ever be an empty string, and is always uppercase. |
mount | The segments of the request URL’s “path”, that have already been matched. Same as rack path_info. This may be an empty array, if the requested URL targets the application root. |
path | The remainder of the request URL’s “path”, split into segments. It designates the virtual “location” of the request’s target within the application. This may be an empty array, if the requested URL targets the application root. |
query | The query parameters from the URL search string, formatted as a map of strings. |
headers | The headers from the HTTP request as a map of strings. Note all headers will be downcased, e.g. %{"content-type" => "text/plain"} |
body | The body content sent with the request |
Summary
Functions
content type is a field of type media type (same as Accept) https://tools.ietf.org/html/rfc7231#section-3.1.1.5
Fetches and parse cookies from the request
Types
request :: %Raxx.Request{body: binary, headers: [{binary, binary}], host: binary, method: binary, mount: [binary], path: [binary], port: :inet.port_number, query: %{optional(binary) => binary}}
Functions
content type is a field of type media type (same as Accept) https://tools.ietf.org/html/rfc7231#section-3.1.1.5
Content type should be send with any content. If not can assume “application/octet-stream” or try content sniffing. because of security risks it is recommended to be able to disable sniffing
Fetches and parse cookies from the request.