Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
method Client.prototype.fetch
import { Client } from "https://deno.land/x/darkflare@v7.2.0/client/mod.ts";

Parameters

method: string
url: string
options: { headers?: Record<string, string>; data?:
| string
| Record<string, unknown>
| ArrayBuffer
| ReadableStream<Uint8Array>
; type:
| "text"
| "json"
| "buffer"
| "stream"
; }

Returns

Promise<{ data: (T extends "text" ? string : T extends "json" ? Record<string, any> : T extends "buffer" ? ArrayBuffer : ReadableStream<Uint8Array>) | undefined; error: unknown; code: number; ok: boolean; headers: Record<string, string>; }>