11

I'm playing around with Deno but I can't find the standard HTTP client.

I also googled "deno http client" which gives me https://deno.land/x/std/http/client/, but the link is broken. Something was indexed by Google and later removed from the repo.

404 - Not Found
This file or directory could not be found.

I found 3rd party libraries soxa and deno-http but I am looking for something standard.

Is there a standard HTTP client for Deno that I am missing?

Evandro Pomatti
  • 13,341
  • 16
  • 97
  • 165

1 Answers1

18

deno implements a variety of Web APIs. To make an HTTP request in deno you use fetch.

const res = await fetch('https://jsonplaceholder.typicode.com/todos/1');
const data = await res.json();

Web APIs are exposed to the global scope the same way they're in the browser. deno aims to be browser compatible whenever it's possible.

You'll also be able to use:

Marcos Casagrande
  • 37,983
  • 8
  • 84
  • 98
  • 1
    The official `deno` document about this: https://deno.land/manual/runtime/web_platform_apis – Yz. Jun 21 '21 at 05:18