View Source Orbit.Request (Orbit v0.3.0)
Encapsulate the request-response cycle.
Analogous to %Plug.Conn{}
.
Request Fields
client_cert
- anOrbit.ClientCertificate
for the client TLS certificate, if providedparams
- combined request parameters from the URI and query params- bare query strings (e.g.
"?foo"
) are assigned to the"_query"
key
- bare query strings (e.g.
uri
- the parsed requestURI
struct
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; its meaning depends on the status codestatus
- the response status code, may be an integer or an atom (seeOrbit.Status
)sent?
- if the response has been transmitted back to the client
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
Summary
Status Functions
Responds with a :bad_request status.
Responds with a :certificate_not_authorized status.
Responds with a :certificate_not_valid status.
Responds with a :cgi_error status.
Responds with a :client_certificate_required status.
Responds with a :gone status.
Responds with a :input status.
Responds with a :not_found status.
Responds with a :permanent_failure status.
Responds with a :proxy_error status.
Responds with a :proxy_request_refused status.
Responds with a :redirect_permanent status.
Responds with a :redirect_temporary status.
Responds with a :sensitive_input status.
Responds with a :server_unavailable status.
Responds with a :slow_down status.
Responds with a :success status.
Responds with a :temporary_failure status.
Functions
Sets multiple assigns on the request.
Sets a single assign on the request.
Stops the request pipeline from further execution.
Puts the body for a successful response.
Sets a single private value on the request.
Puts the status and metadata for a response.
Status Functions
Responds with a :bad_request status.
Responds with a :certificate_not_authorized status.
Responds with a :certificate_not_valid status.
Responds with a :cgi_error status.
Responds with a :client_certificate_required status.
Responds with a :gone status.
Responds with a :input status.
Responds with a :not_found status.
Responds with a :permanent_failure status.
Responds with a :proxy_error status.
Responds with a :proxy_request_refused status.
Responds with a :redirect_permanent status.
Responds with a :redirect_temporary status.
Responds with a :sensitive_input status.
Responds with a :slow_down status.
Responds with a :success status.
Responds with a :temporary_failure status.
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() } }
Functions
Sets multiple assigns on the request.
Sets a single assign on the request.
Stops the request pipeline from further execution.
Puts the body for a successful response.
The MIME type is specified via the meta
argument of put_status/3
.
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.