@woopidi/status-codes
Version:
Http status codes
45 lines (44 loc) • 2.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var HttpStatus;
(function (HttpStatus) {
/**
* Used to return some response headers before final HTTP message.
*/
HttpStatus[HttpStatus["CONTINUE"] = 100] = "CONTINUE";
/**
* The requester has asked the server to switch protocols and the server has agreed to do so.
*/
HttpStatus[HttpStatus["SWITCH_PROTOCOLS"] = 101] = "SWITCH_PROTOCOLS";
/**
* A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request. This code indicates that the server has received and is processing the request, but no response is available yet. This prevents the client from timing out and assuming the request was lost.
*/
HttpStatus[HttpStatus["PROCESSING"] = 102] = "PROCESSING";
/**
* Used to return some response headers before final HTTP message.
*/
HttpStatus[HttpStatus["EARLY_HINTS"] = 103] = "EARLY_HINTS";
/**
* Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action.
*/
HttpStatus[HttpStatus["OK"] = 200] = "OK";
/**
* The request has been fulfilled, resulting in the creation of a new resource.
*/
HttpStatus[HttpStatus["CREATED"] = 201] = "CREATED";
/**
* The request has been accepted for processing, but the processing has not been completed. The request might or might not be eventually acted upon, and may be disallowed when processing occurs.
*/
HttpStatus[HttpStatus["ACCEPTED"] = 202] = "ACCEPTED";
/**
* The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, invalid request message framing, or deceptive request routing).
*/
HttpStatus[HttpStatus["BAD_REQUEST"] = 400] = "BAD_REQUEST";
HttpStatus[HttpStatus["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
HttpStatus[HttpStatus["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
/**
* The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource, or may need an account of some sort.
*/
HttpStatus[HttpStatus["FORBIDDEN"] = 403] = "FORBIDDEN";
})(HttpStatus = exports.HttpStatus || (exports.HttpStatus = {}));
exports.default = HttpStatus;