Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
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/method.ts";

Whether the method is SafeMethod or not.

Examples

Example 1

import { isSafeMethod } from "https://deno.land/x/http_utils@$VERSION/method.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