import { WebApiClient } from "https://deno.land/x/kd_clients@v1.0.0-preview.13/core/WebApiClient.ts";
Provides a base class for HTTP clients.
Properties
private
readonly
headers: HeadersMethods
protected
buildErrorMsg(errorMessage: string, response: Response): stringBuilds an error message from the given error message and response.
containsHeader(name: string): boolean
Returns a value indicating whether or not an HTTP header with the given name exists.
getHeader(name: string): string | null
Gets the value of an HTTP header with a name that matches the given name.
requestDELETE(url: string): Promise<Response>
Deletes a resource by performing an HTTP request using the DELETE method.
requestGET(url: string): Promise<Response>
Gets a resource by performing an HTTP request using the GET method.
requestPATCH(url: string, body: string): Promise<Response>
Updates a resource by performing an HTTP request using the PATCH method.
requestPOST(url: string, body: string | object | Uint8Array): Promise<Response>
Creates a resource by performing an HTTP request using the POST method.
requestPUT(url: string, body: string): Promise<Response>
Modifies a resource by performing an HTTP request using the PUT method.
updateOrAddHeader(name: string, value: string): void
Updates or adds an HTTP header with the given name and value.