2.0.1 • Published 6 years ago

web-status-codes v2.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

web-status-codes

Details status codes for HTTP and related protocols. Based on Bryce Neal's http-status-codes

Completely library agnostic. No production dependencies.

Installation

npm install web-status-codes --save

Usage (express 4.x)

var HttpStatus = require('web-status-codes');

response
	.status(HttpStatus.OK)
	.send('ok');

response
	.status(HttpStatus.INTERNAL_SERVER_ERROR)
	.send({
		error: HttpStatus.getStatusText(HttpStatus.INTERNAL_SERVER_ERROR)
	});

Codes

ConstantCodeStatus Text
ACCEPTED202Accepted
ALREADY_REPORTED208Already Reported
BAD_GATEWAY502Bad Gateway
BAD_REQUEST400Bad Request
BANDWIDTH_LIMIT_EXCEEDED509Bandwidth Limit Exceeded
BLOCKED_BY_PARENTAL_CONTROLS450Blocked by Windows Parental Controls
CLIENT_CLOSED_REQUEST499Client Closed Request
CONFLICT409Conflict
CONTINUE100Continue
CREATED201Created
EARLY_HINTS103Early Hints
ENHANCE_YOUR_CALM420Enhance your calm
EXPECTATION_FAILED417Expectation Failed
FAILED_DEPENDENCY424Failed Dependency
FORBIDDEN403Forbidden
GATEWAY_TIMEOUT504Gateway Timeout
GONE410Gone
HTTP_VERSION_NOT_SUPPORTED505HTTP Version Not Supported
IM_USED226IM Used
IM_A_TEAPOT418I'm a teapot
INSUFFICIENT_SPACE_ON_RESOURCE419Insufficient Space on Resource
INSUFFICIENT_STORAGE507Insufficient Storage
INTERNAL_SERVER_ERROR500Server Error
LENGTH_REQUIRED411Length Required
LOCKED423Locked
LOOP_DETECTED508Loop Detected
METHOD_NOT_ALLOWED405Method Not Allowed
MISDIRECTED_REQUEST421Misdirected Request
MOVED_PERMANENTLY301Moved Permanently
MOVED_TEMPORARILY302Moved Temporarily
MULTI_STATUS207Multi-Status
MULTIPLE_CHOICES300Multiple Choices
NETWORK_AUTHENTICATION_REQUIRED511Network Authentication Required
NETWORK_READ_TIMEOUT598Network Read Timeout Error
NETWORK_CONNECT_TIMEOUT599Network Connect Timeout Error
NO_CONTENT204No Content
NO_RESPONSE444No Response
NON_AUTHORITATIVE_INFORMATION203Non Authoritative Information
NOT_ACCEPTABLE406Not Acceptable
NOT_EXTENDED510Not Extended
NOT_FOUND404Not Found
NOT_IMPLEMENTED501Not Implemented
NOT_MODIFIED304Not Modified
OK200OK
PARTIAL_CONTENT206Partial Content
PAYMENT_REQUIRED402Payment Required
PERMANENT_REDIRECT308Permanent Redirect
PRECONDITION_FAILED412Precondition Failed
PRECONDITION_REQUIRED428Precondition Required
PROCESSING102Processing
PROXY_AUTHENTICATION_REQUIRED407Proxy Authentication Required
REQUEST_HEADER_FIELDS_TOO_LARGE431Request Header Fields Too Large
REQUEST_TIMEOUT408Request Timeout
REQUEST_TOO_LONG413Request Entity Too Large
REQUEST_URI_TOO_LONG414Request-URI Too Long
REQUESTED_RANGE_NOT_SATISFIABLE416Requested Range Not Satisfiable
RETRY_WITH449Retry With
RESET_CONTENT205Reset Content
SEE_OTHER303See Other
SERVICE_UNAVAILABLE503Service Unavailable
SWITCHING_PROTOCOLS101Switching Protocols
TEMPORARY_REDIRECT307Temporary Redirect
TOO_MANY_REQUESTS429Too Many Requests
UNAUTHORIZED401Unauthorized
UNAVAILABLE_FOR_LEGAL_REASONS451Unavailable For Legal Reasons
UNPROCESSABLE_ENTITY422Unprocessable Entity
UNSUPPORTED_MEDIA_TYPE415Unsupported Media Type
USE_PROXY305Use Proxy
UPGRADE_REQUIRED426Upgrade Required
VARIANT_ALSO_NEGOTIATES506Variant Also Negotiates