Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/sinco/tests/deps.ts>Drash.Response#file

Browser Automation and Testing Tool for Deno, written in full TypeScript
Latest
method Drash.Response.prototype.file
import { Drash } from "https://deno.land/x/sinco@v4.1.0/tests/deps.ts";
const { Response } = Drash;

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.

Parameters

filepath: string
  • The filepath of the file to download, relative to the CWD that executed the entrypoint script.
optional
status: number
  • The status ot respond with.
optional
headers: Record<string, string> = [UNSUPPORTED]
  • Any extra headers you wish to specify apart of the content-type header