Skip to main content
Module

x/kall/mod.ts

A lightweight fetch-wrapper for calling REST+JSON-APIs
Latest
import * as kall from "https://deno.land/x/kall@v2.0.0/mod.ts";

A small wrapper around fetch() for consuming REST+JSON-APIs.

Examples

Example 1

import {
  get,
  STATUS_CODE,
} from "https://deno.land/x/olaven/kall/mod.ts";

 * const { status, todo } = await get(
  "https://jsonplaceholder.typicode.com/todos/1",
);

console.log(
  status === STATUS_CODE.OK
    ? `Fetched Todo: ${todo}`
    : `${status} when fetching todo..`,
);

Variables

DELETE method request.

GET method request.

PATCH method request.

POST method request.

PUT method request.

Contains the STATUS_CODE object which contains standard HTTP status codes and provides several type guards for handling status codes with type safety.