Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/denocordts/src/http/mod.ts>RestClient

An Object Oriented Discord API wrapper for Deno.
Latest
class RestClient
extends Collection<string, Record<string, number | Record<string, string | null>>>
import { RestClient } from "https://deno.land/x/denocordts@1.2.0/src/http/mod.ts";

Constructors

new
RestClient(token: string)

Methods

private
addUrlToCollection(url: string, headers: Headers)

Add url to collection with its ratelimit data

private
checks(url: string)
private
createQueue(unnamed 0: { time?: number; href: string; method:
| "GET"
| "POST"
| "PATCH"
| "DELETE"
| "PUT"
; body?: { [key: string]: unknown; } | FormData; headers?: { [key: string]: string; } | HeadersInit; strignifyBody?: boolean; formData: boolean; }
)
request(
href: string,
method:
| "GET"
| "POST"
| "PATCH"
| "DELETE"
| "PUT"
,
body?: { [name: string]: unknown; } | FormData,
headers?: { [name: string]: string; } | HeadersInit,
strignifyBody?: boolean,
formData?,
)