UNPKG

http-response-status-code

Version:

A lightweight utility for retrieving HTTP status codes, names, and descriptions. Easily validate, categorize, and manage HTTP responses with built-in methods for informational, success, redirection, client, and server error codes.

51 lines (50 loc) 2.02 kB
/** * Provides a list of all the informational HTTP status codes. * @name List Informational Codes * @returns {number[]} result - An array of all the informational HTTP status codes. * * @example * var STATUS_CODES = require('http-response-status-code'); * console.log(STATUS_CODES.getInformationalCodes()); // [100, 101, ...] */ export declare function getInformationalCodes(): number[]; /** * Provides a list of all the success HTTP status codes. * @name List Success Codes * @returns {number[]} result - An array of all the success HTTP status codes. * * @example * var STATUS_CODES = require('http-response-status-code'); * console.log(STATUS_CODES.getSuccessCodes()); // [200, 201, ...] */ export declare function getSuccessCodes(): number[]; /** * Provides a list of all the redirection HTTP status codes. * @name List Redirection Codes * @returns {number[]} result - An array of all the redirection HTTP status codes. * * @example * var STATUS_CODES = require('http-response-status-code'); * console.log(STATUS_CODES.getRedirectionalCodes()); // [300, 301, ...] */ export declare function getRedirectionalCodes(): number[]; /** * Provides a list of all the client side error HTTP status codes. * @name List Client Side Error Codes * @returns {number[]} result - An array of all the client side error HTTP status codes. * * @example * var STATUS_CODES = require('http-response-status-code'); * console.log(STATUS_CODES.getClientErrorCodes()); // [400, 401, ...] */ export declare function getClientErrorCodes(): number[]; /** * Provides a list of all the server side error HTTP status codes. * @name List Server Side Error Codes * @returns {number[]} result - An array of all the server side error HTTP status codes. * * @example * var STATUS_CODES = require('http-response-status-code'); * console.log(STATUS_CODES.getServerErrorCodes()); // [500, 501, ...] */ export declare function getServerErrorCodes(): number[];