function printRequest
printRequest(
connection: HttpRequest,
palette: Theme
): string

Everything about one connection: what was sent, what came back, and the body.

What .request prints with nothing narrowing it — the -v of this client, and the reason the narrower spellings exist at all.

import { printRequest } from './print-request.ts';

const plain = { painter: () => (text: string) => text };
const request = { verb: 'GET', url: 'http://x/y', headers: new Map(), body: null };
printRequest({ id: 1, request, response: null, failed: 'connection refused', ms: 2, at: 0 }, plain)
  .includes('connection refused'); // true

Parameters

connection: HttpRequest
palette: Theme

Return Type

string

Usage

import { printRequest } from "lib/commands/repl/print-request.ts";