2.0.1 • Published 10 months ago

http-status-ts v2.0.1

Weekly downloads
61
License
MIT
Repository
github
Last release
10 months ago

GitHub npm bundle size npm

What is http-status-ts?

http-status-ts is a tiny helper library that provides a convenient list of HTTP status codes for use with TypeScript. It is isomorphic and can be used with NodeJs or in a browser.

Installation

Install the http-status-ts package from npm. npm install http-status-ts

Usage

HTTP status codes are provided as an enum.

console.log(HttpStatus.INTERNAL_SERVER_ERROR);
// => 500

You can also obtain a text description.

console.log(httpStatusTextByCode(HttpStatus.INTERNAL_SERVER_ERROR));
// => "Internal Server Error"

HTTP Status Codes

All http status codes are included.

EnumCodeText
CONTINUE100Continue
SWITCHING_PROTOCOLS101Switching Protocols
PROCESSING102Processing
EARLY_HINTS103Early Hints
OK200OK
CREATED201Created
ACCEPTED202Accepted
NON_AUTHORITATIVE_INFORMATION203Non-Authoritative Information
NO_CONTENT204No Content
RESET_CONTENT205Reset Content
PARTIAL_CONTENT206Partial Content
MULTI_STATUS207Multi-Status
ALREADY_REPORTED208Already Reported
IM_USED226IM Used
MULTIPLE_CHOICES300Multiple Choices
MOVED_PERMANENTLY301Moved Permanently
FOUND302Found
SEE_OTHER303See Other
NOT_MODIFIED304Not Modified
USE_PROXY305Use Proxy
TEMPORARY_REDIRECT307Temporary Redirect
PERMANENT_REDIRECT308Permanent Redirect
BAD_REQUEST400Bad Request
UNAUTHORIZED401Unauthorized
PAYMENT_REQUIRED402Payment Required
FORBIDDEN403Forbidden
NOT_FOUND404Not Found
METHOD_NOT_ALLOWED405Method Not Allowed
NOT_ACCEPTABLE406Not Acceptable
PROXY_AUTHENTICATION_REQUIRED407Proxy Authentication Required
REQUEST_TIMEOUT408Request Timeout
CONFLICT409Conflict
GONE410Gone
LENGTH_REQUIRED411Length Required
PRECONDITION_FAILED412Precondition Failed
PAYLOAD_TOO_LARGE413Payload Too Large
URI_TOO_LONG414URI Too Long
UNSUPPORTED_MEDIA_TYPE415Unsupported Media Type
RANGE_NOT_SATISFIABLE416Range Not Satisfiable
EXPECTATION_FAILED417Expectation Failed
MISDIRECTED_REQUEST421Misdirected Request
UNPROCESSABLE_ENTITY422Unprocessable Entity
LOCKED423Locked
FAILED_DEPENDENCY424Failed Dependency
TOO_EARLY425Too Early
UPGRADE_REQUIRED426Upgrade Required
PRECONDITION_REQUIRED428Precondition Required
TOO_MANY_REQUESTS429Too Many Requests
REQUEST_HEADER_FIELDS_TOO_LARGE431Request Header Fields Too Large
UNAVAILABLE_FOR_LEGAL_REASONS451Unavailable For Legal Reasons
INTERNAL_SERVER_ERROR500Internal Server Error
NOT_IMPLEMENTED501Not Implemented
BAD_GATEWAY502Bad Gateway
SERVICE_UNAVAILABLE503Service Unavailable
GATEWAY_TIMEOUT504Gateway Timeout
HTTP_VERSION_NOT_SUPPORTED505HTTP Version Not Supported
VARIANT_ALSO_NEGOTIATES506Variant Also Negotiates
INSUFFICIENT_STORAGE507Insufficient Storage
LOOP_DETECTED508Loop Detected
NOT_EXTENDED510Not Extended
NETWORK_AUTHENTICATION_REQUIRED511Network Authentication Required
2.0.1

10 months ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.11

2 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago