Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/deps/std/http/http_status.ts

Deno-powered framework for building business web apps
Go to Latest
Deprecated

(will be removed after 0.210.0) Import from std/http/status.ts instead.

Contains the enum Status which enumerates standard HTTP status codes and provides several type guards for handling status codes with type safety.

import * as netzo from "https://deno.land/x/netzo@0.3.91/deps/std/http/http_status.ts";

Examples

Example 1

import {
  Status,
  STATUS_TEXT,
} from "https://deno.land/std@0.224.0/http/http_status.ts";

console.log(Status.NotFound); //=> 404
console.log(STATUS_TEXT[Status.NotFound]); //=> "Not Found"
import { isErrorStatus } from "https://deno.land/std@0.224.0/http/http_status.ts";

const res = await fetch("https://example.com/");

if (isErrorStatus(res.status)) {
  // error handling here...
}

Variables

v
isErrorStatus
deprecated
v
isRedirectStatus
deprecated
v
Status
deprecated
v
STATUS_TEXT
deprecated

Type Aliases

T
ErrorStatus
deprecated
T
RedirectStatus
deprecated
T
Status
deprecated
T
SuccessfulStatus
deprecated