interface Response

What came back. Absent on an HttpRequest that never got a reply.

Properties

status: number

The code, which is an answer even when it is a 404.

statusText: string

'' where the protocol does not carry one — HTTP/2 never does.

headers: ReadonlyMap<string, string>

Lower-cased names, as they came off the wire.

body: string

Decoded text, or '' where the body was not text.

bytes: number

The size on the wire, which is the honest number even where the body was not kept.

True where the body was longer than the cap and the rest was dropped, unread.

binary: boolean

True where the content type is not something a terminal should be asked to print.

Usage

import { type Response } from "lib/repl/http-service.ts";