Skip to main content
Module

x/nhttp/mod.ts>HttpResponse

An Simple http framework for Deno, Deno Deploy and Cloudflare Workers. so hot 🚀
Go to Latest
class HttpResponse
import { HttpResponse } from "https://deno.land/x/nhttp@1.1.11/mod.ts";

Index Signatures

[k: string]: TRet

Properties

clearCookie: (name: string, options?: Cookie) => void

clear cookie

header: (key?: TObject | string, value?: string) => HttpResponse | (HttpResponse & Headers) | (HttpResponse & string)

set header or get header

json: (body: TObject | null) => Promise<void> | Response

shorthand for send json body

redirect: (url: string, status?: number) => Response | Promise<void>

redirect url

send: (body?: BodyInit | TObject | null) => Promise<void> | Response

send response body

status: (code?: number) => HttpResponse | (HttpResponse & number)

set status or get status

type: (contentType: string) => HttpResponse

shorthand for content-type headers