@tkrotoff/fetch
Version:
Fetch wrapper
97 lines (96 loc) • 6.05 kB
JavaScript
/**
* List of HTTP status codes.
*
* [List of HTTP status codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
* [Rails HTTP Status Code to Symbol Mapping](https://web.archive.org/web/20131211220540/http://www.codyfauser.com/2008/7/4/rails-http-status-code-to-symbol-mapping)
*
* https://www.rubydoc.info/github/rack/rack/master/Rack/Utils#HTTP_STATUS_CODES-constant
*
* curl -s https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv | \
* ruby -ne 'm = /^(\d{3}),(?!Unassigned|\(Unused\))([^,]+)/.match($_) and \
* puts "_#{m[1]}_#{m[2].delete %Q[ ]} = #{m[1]},"'
*/
export var HttpStatus;
(function (HttpStatus) {
/*
* 1xx informational response
*/
HttpStatus[HttpStatus["_100_Continue"] = 100] = "_100_Continue";
HttpStatus[HttpStatus["_101_SwitchingProtocols"] = 101] = "_101_SwitchingProtocols";
HttpStatus[HttpStatus["_102_Processing"] = 102] = "_102_Processing";
HttpStatus[HttpStatus["_103_EarlyHints"] = 103] = "_103_EarlyHints";
/*
* 2xx success
*/
HttpStatus[HttpStatus["_200_OK"] = 200] = "_200_OK";
HttpStatus[HttpStatus["_201_Created"] = 201] = "_201_Created";
HttpStatus[HttpStatus["_202_Accepted"] = 202] = "_202_Accepted";
HttpStatus[HttpStatus["_203_NonAuthoritativeInformation"] = 203] = "_203_NonAuthoritativeInformation";
HttpStatus[HttpStatus["_204_NoContent"] = 204] = "_204_NoContent";
HttpStatus[HttpStatus["_205_ResetContent"] = 205] = "_205_ResetContent";
HttpStatus[HttpStatus["_206_PartialContent"] = 206] = "_206_PartialContent";
HttpStatus[HttpStatus["_207_MultiStatus"] = 207] = "_207_MultiStatus";
HttpStatus[HttpStatus["_208_AlreadyReported"] = 208] = "_208_AlreadyReported";
HttpStatus[HttpStatus["_226_IMUsed"] = 226] = "_226_IMUsed";
/*
* 3xx redirection
*/
HttpStatus[HttpStatus["_300_MultipleChoices"] = 300] = "_300_MultipleChoices";
HttpStatus[HttpStatus["_301_MovedPermanently"] = 301] = "_301_MovedPermanently";
HttpStatus[HttpStatus["_302_Found"] = 302] = "_302_Found";
HttpStatus[HttpStatus["_303_SeeOther"] = 303] = "_303_SeeOther";
HttpStatus[HttpStatus["_304_NotModified"] = 304] = "_304_NotModified";
HttpStatus[HttpStatus["_305_UseProxy"] = 305] = "_305_UseProxy";
HttpStatus[HttpStatus["_307_TemporaryRedirect"] = 307] = "_307_TemporaryRedirect";
HttpStatus[HttpStatus["_308_PermanentRedirect"] = 308] = "_308_PermanentRedirect";
/*
* 4xx client errors
*/
HttpStatus[HttpStatus["_400_BadRequest"] = 400] = "_400_BadRequest";
HttpStatus[HttpStatus["_401_Unauthorized"] = 401] = "_401_Unauthorized";
HttpStatus[HttpStatus["_402_PaymentRequired"] = 402] = "_402_PaymentRequired";
HttpStatus[HttpStatus["_403_Forbidden"] = 403] = "_403_Forbidden";
HttpStatus[HttpStatus["_404_NotFound"] = 404] = "_404_NotFound";
HttpStatus[HttpStatus["_405_MethodNotAllowed"] = 405] = "_405_MethodNotAllowed";
HttpStatus[HttpStatus["_406_NotAcceptable"] = 406] = "_406_NotAcceptable";
HttpStatus[HttpStatus["_407_ProxyAuthenticationRequired"] = 407] = "_407_ProxyAuthenticationRequired";
HttpStatus[HttpStatus["_408_RequestTimeout"] = 408] = "_408_RequestTimeout";
HttpStatus[HttpStatus["_409_Conflict"] = 409] = "_409_Conflict";
HttpStatus[HttpStatus["_410_Gone"] = 410] = "_410_Gone";
HttpStatus[HttpStatus["_411_LengthRequired"] = 411] = "_411_LengthRequired";
HttpStatus[HttpStatus["_412_PreconditionFailed"] = 412] = "_412_PreconditionFailed";
HttpStatus[HttpStatus["_413_PayloadTooLarge"] = 413] = "_413_PayloadTooLarge";
HttpStatus[HttpStatus["_414_URITooLong"] = 414] = "_414_URITooLong";
HttpStatus[HttpStatus["_415_UnsupportedMediaType"] = 415] = "_415_UnsupportedMediaType";
HttpStatus[HttpStatus["_416_RangeNotSatisfiable"] = 416] = "_416_RangeNotSatisfiable";
HttpStatus[HttpStatus["_417_ExpectationFailed"] = 417] = "_417_ExpectationFailed";
HttpStatus[HttpStatus["_421_MisdirectedRequest"] = 421] = "_421_MisdirectedRequest";
HttpStatus[HttpStatus["_422_UnprocessableEntity"] = 422] = "_422_UnprocessableEntity";
HttpStatus[HttpStatus["_423_Locked"] = 423] = "_423_Locked";
HttpStatus[HttpStatus["_424_FailedDependency"] = 424] = "_424_FailedDependency";
HttpStatus[HttpStatus["_425_TooEarly"] = 425] = "_425_TooEarly";
HttpStatus[HttpStatus["_426_UpgradeRequired"] = 426] = "_426_UpgradeRequired";
HttpStatus[HttpStatus["_428_PreconditionRequired"] = 428] = "_428_PreconditionRequired";
HttpStatus[HttpStatus["_429_TooManyRequests"] = 429] = "_429_TooManyRequests";
HttpStatus[HttpStatus["_431_RequestHeaderFieldsTooLarge"] = 431] = "_431_RequestHeaderFieldsTooLarge";
HttpStatus[HttpStatus["_451_UnavailableForLegalReasons"] = 451] = "_451_UnavailableForLegalReasons";
/*
* 5xx server errors
*/
HttpStatus[HttpStatus["_500_InternalServerError"] = 500] = "_500_InternalServerError";
HttpStatus[HttpStatus["_501_NotImplemented"] = 501] = "_501_NotImplemented";
HttpStatus[HttpStatus["_502_BadGateway"] = 502] = "_502_BadGateway";
HttpStatus[HttpStatus["_503_ServiceUnavailable"] = 503] = "_503_ServiceUnavailable";
HttpStatus[HttpStatus["_504_GatewayTimeout"] = 504] = "_504_GatewayTimeout";
HttpStatus[HttpStatus["_505_HTTPVersionNotSupported"] = 505] = "_505_HTTPVersionNotSupported";
HttpStatus[HttpStatus["_506_VariantAlsoNegotiates"] = 506] = "_506_VariantAlsoNegotiates";
HttpStatus[HttpStatus["_507_InsufficientStorage"] = 507] = "_507_InsufficientStorage";
HttpStatus[HttpStatus["_508_LoopDetected"] = 508] = "_508_LoopDetected";
HttpStatus[HttpStatus["_510_NotExtended"] = 510] = "_510_NotExtended";
HttpStatus[HttpStatus["_511_NetworkAuthenticationRequired"] = 511] = "_511_NetworkAuthenticationRequired";
/*
* Unofficial codes
*/
// A deprecated response used by the Spring Framework when a method has failed
HttpStatus[HttpStatus["_420_MethodFailure"] = 420] = "_420_MethodFailure";
})(HttpStatus || (HttpStatus = {}));