Skip to main content
Module

x/ghst/res.ts>HTTPResponse

A light-weight http framework built for Deno.
Go to Latest
class HTTPResponse
import { HTTPResponse } from "https://deno.land/x/ghst@1.1.1/res.ts";

Constructors

new
HTTPResponse()

Properties

body: ResponseBody

The body of the response.

readonly
headers: { [key: string]: string; }

Headers the response has.

status: number

Status code of the response.

Methods

render(path: string, values: { [key: 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.