Skip to main content
Module

x/cav/http.ts>response

A server framework for Deno
Go to Latest
function response
import { response } from "https://deno.land/x/cav@0.0.8/http.ts";

Creates a TypedResponse from the provided body, which undergoes packing via packBody. Extra packers can be provided using the "packers" option on the init argument. If a Response is passed in as the body, its body will be used without re-packing; headers and status/text will still be updated to match the provided init.

Type Parameters

optional
T = unknown

Parameters

body: T
optional
init: TypedResponseInit

Returns

TypedResponse<T extends TypedResponse<infer T2> ? T2 : T extends Response ? unknown : T>