import { HTTPResponse } from "https://deno.land/x/ghst@v1.1.4/res.ts";
Constructors
new
HTTPResponse(requestEvent: Deno.RequestEvent)Properties
private
_requestEvent: Deno.RequestEventMethods
end()
Sends the request. If not called then will automatically be called.
json(content: any)
Responds to the request with a JSON object. Use send or append instead, does the same now.
redirect(url: string)
Redirects the response using the Location header. Also sets the status to 308 so the request method doesn't change when redirected.
render(path: string, values: Record<string, string>)
Reads a file and replaces text with specified values.
send(content: ResponseBody)
Updates the body of the response.
sendFile(path: string)
Sets the body of the response to be the contents of a file.
setHeader(name: string, value: string)
Adds a header to the response.
setStatus(code: number)
Sets the status code of the response.