Skip to main content
Module

x/aleph/types.d.ts>APIResponse

The Full-stack Framework in Deno.
Go to Latest
interface APIResponse
import { type APIResponse } from "https://deno.land/x/aleph@v0.3.0-beta.7/types.d.ts";

An interface that aligns to the parts of the Response with helpers.

Properties

status: number
headers: Headers
optional
body:
| string
| Uint8Array
| ArrayBuffer
| ReadableStream<Uint8Array>

Methods

addHeader(key: string, value: string): this

addHeader adds a new value onto an existing response header of the request, or adds the header if it does not already exist.

setHeader(key: string, value: string): this

setHeader sets a new value for an existing response header of the request, or adds the header if it does not already exist.

removeHeader(key: string): this

removeHeader removes the value for an existing response header of the request.

redirect(url: string, status?: number): this

redirect replies to redirect the client to another URL with optional response status defaulting to 302.

json(data: any, space?: string | number): this

json replies to the request with a json content.