Skip to main content
Module

x/simple_utility/mod.ts>httpAuth

Useful snippet collection.
Go to Latest
function httpAuth
import { httpAuth } from "https://deno.land/x/simple_utility@v1.3.5/mod.ts";

Add Authorization to object.

Examples

Example 1

await fetchExtend("path", "ok", {
    headers: {
        ...httpAuth("Basic", "cm9vdDpyb290")
    }
});

Parameters

type: string
credential: string

Returns

Record<string, string>