import { Response } from "https://dotland.deno.dev/x/drash@v2.7.0/mod.ts";
Methods
deleteCookie(name: string, attributes?: { domain: string; path?: string; }): void
Delete a cookie for the response.
download(): void
filepath: string,
contentType: string,
headers?: Record<string, string>,
Set the body of this response as a downloaded type given the filepath, filename, and content type of the downloadable type.
file(): void
filepath: string,
status?: number,
headers?: Record<string, string>,
Set the body of this response as the contents of the given filepath. The Content-Type header will be set automatically based on the extension of the filepath.
html(): void
html: string,
status?: number,
headers?: Record<string, string>,
Set the body of this response as HTML.
json()
json: object,
status?: number,
headers?: Record<string, string>,
Set the body of this response as JSON.
render(_filepath: string, _data: unknown): boolean | string
This method allows users to make this.response.render()
calls in
resources. This method is also used by Tengine:
https://github.com/drashland/deno-drash-middleware/tree/master/tengine
text()
text: string,
status?: number,
headers?: Record<string, string>,
Set the body of this response as text.
xml()
xml: string,
status?: number,
headers?: Record<string, string>,
Set the body of this response as XML.