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

Create a custom HttpClient to use with fetch. This is an extension of the web platform Fetch API which allows Deno to use custom TLS certificates and connect via a proxy while using fetch().


Example 1

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

Example 2

const client = Deno.createHttpClient({
  proxy: { url: "" }
const response = await fetch("", { client });