Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/cli/dts/lib.deno.unstable.d.ts>Deno.HttpClient

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface Deno.HttpClient
import { type Deno } from "https://deno.land/x/deno@v1.28.0/cli/dts/lib.deno.unstable.d.ts";
const { HttpClient } = Deno;

UNSTABLE: New API, yet to be vetted.

A custom HttpClient for use with fetch function. This is designed to allow custom certificates or proxies to be used with fetch().

const caCert = await Deno.readTextFile("./ca.pem");
const client = Deno.createHttpClient({ caCerts: [ caCert ] });
const req = await fetch("https://myserver.com", { client });

Properties

rid: number

The resource ID associated with the client.

Methods

close(): void

Close the HTTP client.