raxx v0.14.9 Raxx.Request
HTTP requests to a Raxx application are encapsulated in a Raxx.Request
struct.
A request has all the properties of the url it was sent to. In addition it has optional content, in the body. As well as a variable number of headers that contain meta data.
Where appropriate URI properties are named from this definition.
scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
from wikipedia
The contents are itemised below:
scheme | http or https , depending on the transport used. |
authority | The location of the hosting server, as a binary. e.g. www.example.com . Plus an optional port number, separated from the hostname by a colon |
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 |
Link to this section Summary
Link to this section Types
Method to indicate the desired action to be performed on the identified resource.
Scheme describing protocol used.
Link to this type
t()
t() :: %Raxx.Request{authority: binary(), body: Raxx.body(), headers: Raxx.headers(), method: method(), mount: [binary()], path: [binary()], query: %{optional(binary()) => binary()} | nil, scheme: scheme()}
Elixir representation for an HTTP request.