View Source Orbit.Request (Orbit v0.2.2)
Encapsulate the request-response cycle.
Analogous to %Plug.Conn{}
.
request-fields
Request Fields
client_cert
- anOrbit.ClientCertificate
for the client TLS certificate, if providedparams
- combined request parameters from the URI and query paramsuri
- the parsed requestURI
struct
response-fields
Response Fields
body
- the response body; may be an iolist or a streamhalted?
- if the current response pipeline should be stopped prematurelymeta
- the response meta field, meaning depends on the status codestatus
- the response status code, may be an integer or an atom (see below)sent?
- if the response has been transmitted back to the client
application-fields
Application Fields
assigns
- a generic map of application-defined data to be manipulated and renderedprivate
- a generic map of library-defined data that should not be accessed by end-users
Link to this section Summary
Functions
Sets multiple assigns on the request.
Sets a single assign on the request.
Stops the request pipeline from further execution.
Puts the body and MIME type for a successful response.
Sets a single private value on the request.
Puts the status and metadata for a response.
Respond with a success status containing body content.
Link to this section Types
@type t() :: %Orbit.Request{ assigns: %{required(atom()) => any()}, body: IO.chardata() | %Stream{accs: term(), done: term(), enum: term(), funs: term()} | nil, client_cert: any(), halted?: boolean(), meta: IO.chardata() | nil, params: %{required(String.t()) => String.t()}, private: %{optional(atom()) => any()}, sent?: boolean(), status: Orbit.Status.t(), uri: %URI{ authority: term(), fragment: term(), host: term(), path: term(), port: term(), query: term(), scheme: term(), userinfo: term() } }
Link to this section Functions
Sets multiple assigns on the request.
Sets a single assign on the request.
Stops the request pipeline from further execution.
Puts the body and MIME type for a successful response.
The MIME type is optional. If unspecified, clients will default to "text/gemini; charset=utf-8".
Sets a single private value on the request.
Puts the status and metadata for a response.
If the status code is non-successful, then the response body will be ignored and not sent to the client.
The status can be an integer or an atom. See Orbit.Status
for a list of applicable status codes and
convenience functions.
Respond with a success status containing body content.