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

x/kd_clients/core/WebApiClient.ts>WebApiClient

Various types of HTTP clients for misc uses. This is used in the organization's infrastructure.
Go to Latest
class WebApiClient
Abstract
import { WebApiClient } from "https://deno.land/x/kd_clients@v0.0.5/core/WebApiClient.ts";

Provides a base class for HTTP clients.

Properties

protected
baseUrl: string
protected
readonly
headers: Headers

Methods

protected
getResponseData<T>(response: Response): Promise<T>

Gets the data from an HTTP response.

protected
requestDELETE(url: string): Promise<Response>

Deletes a resource by performing an HTTP request using the DELETE method.

protected
requestGET(url: string): Promise<Response>

Gets a resource by performing an HTTP request using the GET method.

protected
requestPATCH(url: string, body: string): Promise<Response>

Updates a resource by performing an HTTP request using the PATCH method.

protected
requestPOST(url: string, body: string | object): Promise<Response>

Creates a resource by performing an HTTP request using the POST method.

protected
requestPUT(url: string, body: string): Promise<Response>

Modifies a resource by performing an HTTP request using the PUT method.

protected
setHeader(name: string, value: string): void

Sets an HTTP header with a name that matches the given name to the given value.