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

x/revolt_api/client.ts>fetchAPI

a typed revolt api client
Latest
variable fetchAPI
import { fetchAPI } from "https://deno.land/x/revolt_api@0.4.0/client.ts";

Fetch a resource from the API. It returns a Promise that resolves to the Response to that Request, whether it is successful or not.

Mostly equivilent to the build in fetch function, but typed.

changes:

  • allows a base to be specified
  • url queries will be typed added to the request
  • will type error if the route expects a body
  • the method for the request will be typed
  • the result is typed for json output