Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/tpy/src/tpy.ts>Tpy#httpRaw

🔑 A strongly typed Pylon API client.
Latest
method Tpy.prototype.httpRaw
import { Tpy } from "https://deno.land/x/tpy@v1.0.0-RC/src/tpy.ts";

Makes a request to the API and creates possible errors according to the response.

Type Parameters

T

The return type of the response body.

Parameters

ctx: Context

The resource to request that will be concatenated with the API URL.

resource: string

Cases to run through to find errors in the response.

optional
cases: Cases = [UNSUPPORTED]

HTTP method to use. Currently, the Pylon API only uses GET and POST.

optional
method: HTTPVerbs = [UNSUPPORTED]

Other fetch parameters.

optional
requestInit: RequestInit = [UNSUPPORTED]

Whether to parse out the body or not, default is true.

Returns

Promise<T>