1.0.1 • Published 2 years ago

http-statusify v1.0.1

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

http-statusify

This is an agnostic package that provides an enum collection of HTTP response status codes from the official RFCs and others used by NGINX and some unofficial status codes. The package has support for Javascript and Typescript.

Installation

npm install http-statusify --save

Features

Enum collection of HTTP Response Status Codes

import {
	StatusCodes,
} from 'http-statusify';

// For example
StatusCodes.OK // 200
StatusCodes.CREATED // 201
StatusCodes.NOT_FOUND // 404

HTTP Response Status Codes Collection

HTTP Status CodeKeyDescriptionOrigin
100CONTINUEContinueRFC7231
101SWITCHING_PROTOCOLSSwitching ProtocolsRFC7231
102PROCESSINGProcessingRFC2518
103EARLY_HINTSEarly HintsRFC8297
200OKOKRFC7231
201CREATEDCreatedRFC7231
202ACCEPTEDAcceptedRFC7231
203NON_AUTHORITATIVE_INFORMATIONNon-Authoritative InformationRFC7231
204NO_CONTENTNo ContentRFC7231
205RESET_CONTENTReset ContentRFC7231
206PARTIAL_CONTENTPartial ContentRFC7233
207MULTI_STATUSMulti-StatusRFC2518
208ALREADY_REPORTEDAlready ReportedRFC5842
226IM_USEDIM UsedRFC3229
300MULTIPLE_CHOICESMultiple ChoicesRFC7231
301MOVED_PERMANENTLYMoved PermanentlyRFC7231
302FOUNDFoundRFC7231
303SEE_OTHERSee OtherRFC7231
304NOT_MODIFIEDNot ModifiedRFC7232
305USE_PROXYUse ProxyRFC7231
307TEMPORARY_REDIRECTTemporary RedirectRFC7231
308PERMANENT_REDIRECTPermanent RedirectRFC7538
400BAD_REQUESTBad RequestRFC7231
401UNAUTHORIZEDUnauthorizedRFC7235
402PAYMENT_REQUIREDPayment RequiredRFC7231
403FORBIDDENForbiddenRFC7231
404NOT_FOUNDNot FoundRFC7231
405METHOD_NOT_ALLOWEDMethod Not AllowedRFC7231
406NOT_ACCEPTABLENot AcceptableRFC7231
407PROXY_AUTHENTICATION_REQUIREDProxy Authentication RequiredRFC7235
408REQUEST_TIMEOUTRequest TimeoutRFC7231
409CONFLICTConflictRFC7231
410GONEGoneRFC7231
411LENGTH_REQUIREDLength RequiredRFC7231
412PRECONDITION_FAILEDPrecondition FailedRFC7232
413PAYLOAD_TOO_LARGEPayload Too LargeRFC7231
414URI_TOO_LONGURI Too LongRFC7231
415UNSUPPORTED_MEDIA_TYPEUnsupported Media TypeRFC7231
416RANGE_NOT_SATISFIABLERange Not SatisfiableRFC7233
417EXPECTATION_FAILEDExpectation FailedRFC7231
418IM_A_TEAPOTI'm a TeapotRFC2324
421MISDIRECTED_REQUESTMisdirected RequestRFC7540
422UNPROCESSABLE_ENTITYUnprocessable EntityRFC2518
423LOCKEDLockedRFC2518
424FAILED_DEPENDENCYFailed DependencyRFC2518
425TOO_EARLYToo EarlyRFC8470
426UPGRADE_REQUIREDUpgrade RequiredRFC7231
428PRECONDITION_REQUIREDPrecondition RequiredRFC6585
429TOO_MANY_REQUESTSToo Many RequestsRFC6585
431REQUEST_HEADER_FIELDS_TOO_LARGERequest Header Fields Too LargeRFC6585
451UNAVAILABLE_FOR_LEGAL_REASONSUnavailable For Legal ReasonsRFC7725
499CLIENT_CLOSED_REQUESTClient Closed RequestNGINX
500INTERNAL_SERVER_ERRORInternal Server ErrorRFC7231
501NOT_IMPLEMENTEDNot ImplementedRFC7231
502BAD_GATEWAYBad GatewayRFC7231
503SERVICE_UNAVAILABLEService UnavailableRFC7231
504GATEWAY_TIMEOUTGateway TimeoutRFC7231
505HTTP_VERSION_NOT_SUPPORTEDHTTP Version Not SupportedRFC7231
506VARIANT_ALSO_NEGOTIATESVariant Also NegotiatesRFC2295
507INSUFFICIENT_STORAGEInsufficient StorageRFC2518
508LOOP_DETECTEDLoop DetectedRFC5842
509BANDWIDTH_LIMIT_EXCEEDEDBandwidth Limit ExceededNo Official
510NOT_EXTENDEDNot ExtendedRFC2774
511NETWORK_AUTHENTICATION_REQUIREDNetwork Authentication RequiredRFC6585
599NETWORK_CONNECT_TIMEOUT_ERRORNetwork Connect Timeout ErrorNo Official