Skip to main content
Module

x/http_utils/method.ts>isSafeMethod

HTTP utility collection for Fetch API
Go to Latest
function isSafeMethod
import { isSafeMethod } from "https://deno.land/x/http_utils@1.0.0-beta.14/method.ts";

Whether the method is SafeMethod or not.

Examples

Example 1

import { isSafeMethod } from "https://deno.land/x/http_utils@$VERSION/mod.ts";
import { assert } from "https://deno.land/std@$VERSION/testing/asserts.ts";

assert(isSafeMethod("GET"));
assert(isSafeMethod("HEAD"));
assert(isSafeMethod("OPTIONS"));
assert(isSafeMethod("TRACE"));

Parameters

method: string