import { type KyukoResponse } from "https://deno.land/x/kyuko@v0.6.3/mod.ts";
The response object that is handled in Kyuko applications.
Responsible for storing information about the response to the request,
as well as sending the response via the send()
and redirect()
methods.
Note that send()
or redirect()
must be called or else the request will hang.
Methods
Redirects the request to a new address
.
The address
can be either a relative url path, or a full url.
The optional status
parameter can be used to set a custom status code.
Otherwise overrides the current res.statusCode
with 302.
Sends a proper json response to the original request.
The json is stringify
'd from the input JavaScript object
.
Sends a response to the original request that instantiated this object. The response is built using the public attributes of this object, which should've been set by the user beforehand.