UNPKG

43.5 kBTypeScriptView Raw
1import { StatusCodes, ReasonPhrases } from './codes';
2/**
3 * Returns the reason phrase for the given status code.
4 * If the given status code does not exist, an error is thrown.
5 *
6 * @param {number|string} statusCode The HTTP status code
7 * @returns {string} The associated reason phrase (e.g. "Bad Request", "OK")
8 * */
9export declare function getReasonPhrase(statusCode: (number | string)): (string);
10/**
11 * Returns the status code for the given reason phrase.
12 * If the given reason phrase does not exist, undefined is returned.
13 *
14 * @param {string} reasonPhrase The HTTP reason phrase (e.g. "Bad Request", "OK")
15 * @returns {string} The associated status code
16 * */
17export declare function getStatusCode(reasonPhrase: string): (number);
18/**
19 * @deprecated
20 *
21 * Returns the reason phrase for the given status code.
22 * If the given status code does not exist, undefined is returned.
23 *
24 * Deprecated in favor of getReasonPhrase
25 *
26 * @param {number|string} statusCode The HTTP status code
27 * @returns {string|undefined} The associated reason phrase (e.g. "Bad Request", "OK")
28 * */
29export declare const getStatusText: typeof getReasonPhrase;
30export { StatusCodes, ReasonPhrases, };
31/**
32 * @deprecated Please use StatusCodes.ACCEPTED
33 *
34 * */
35export declare const ACCEPTED = 202;
36/**
37 * @deprecated Please use StatusCodes.BAD_GATEWAY
38 *
39 * */
40export declare const BAD_GATEWAY = 502;
41/**
42 * @deprecated Please use StatusCodes.BAD_REQUEST
43 *
44 * */
45export declare const BAD_REQUEST = 400;
46/**
47 * @deprecated Please use StatusCodes.CONFLICT
48 *
49 * */
50export declare const CONFLICT = 409;
51/**
52 * @deprecated Please use StatusCodes.CONTINUE
53 *
54 * */
55export declare const CONTINUE = 100;
56/**
57 * @deprecated Please use StatusCodes.CREATED
58 *
59 * */
60export declare const CREATED = 201;
61/**
62 * @deprecated Please use StatusCodes.EXPECTATION_FAILED
63 *
64 * */
65export declare const EXPECTATION_FAILED = 417;
66/**
67 * @deprecated Please use StatusCodes.FAILED_DEPENDENCY
68 *
69 * */
70export declare const FAILED_DEPENDENCY = 424;
71/**
72 * @deprecated Please use StatusCodes.FORBIDDEN
73 *
74 * */
75export declare const FORBIDDEN = 403;
76/**
77 * @deprecated Please use StatusCodes.GATEWAY_TIMEOUT
78 *
79 * */
80export declare const GATEWAY_TIMEOUT = 504;
81/**
82 * @deprecated Please use StatusCodes.GONE
83 *
84 * */
85export declare const GONE = 410;
86/**
87 * @deprecated Please use StatusCodes.HTTP_VERSION_NOT_SUPPORTED
88 *
89 * */
90export declare const HTTP_VERSION_NOT_SUPPORTED = 505;
91/**
92 * @deprecated Please use StatusCodes.IM_A_TEAPOT
93 *
94 * */
95export declare const IM_A_TEAPOT = 418;
96/**
97 * @deprecated Please use StatusCodes.INSUFFICIENT_SPACE_ON_RESOURCE
98 *
99 * */
100export declare const INSUFFICIENT_SPACE_ON_RESOURCE = 419;
101/**
102 * @deprecated Please use StatusCodes.INSUFFICIENT_STORAGE
103 *
104 * */
105export declare const INSUFFICIENT_STORAGE = 507;
106/**
107 * @deprecated Please use StatusCodes.INTERNAL_SERVER_ERROR
108 *
109 * */
110export declare const INTERNAL_SERVER_ERROR = 500;
111/**
112 * @deprecated Please use StatusCodes.LENGTH_REQUIRED
113 *
114 * */
115export declare const LENGTH_REQUIRED = 411;
116/**
117 * @deprecated Please use StatusCodes.LOCKED
118 *
119 * */
120export declare const LOCKED = 423;
121/**
122 * @deprecated Please use StatusCodes.METHOD_FAILURE
123 *
124 * */
125export declare const METHOD_FAILURE = 420;
126/**
127 * @deprecated Please use StatusCodes.METHOD_NOT_ALLOWED
128 *
129 * */
130export declare const METHOD_NOT_ALLOWED = 405;
131/**
132 * @deprecated Please use StatusCodes.MOVED_PERMANENTLY
133 *
134 * */
135export declare const MOVED_PERMANENTLY = 301;
136/**
137 * @deprecated Please use StatusCodes.MOVED_TEMPORARILY
138 *
139 * */
140export declare const MOVED_TEMPORARILY = 302;
141/**
142 * @deprecated Please use StatusCodes.MULTI_STATUS
143 *
144 * */
145export declare const MULTI_STATUS = 207;
146/**
147 * @deprecated Please use StatusCodes.MULTIPLE_CHOICES
148 *
149 * */
150export declare const MULTIPLE_CHOICES = 300;
151/**
152 * @deprecated Please use StatusCodes.NETWORK_AUTHENTICATION_REQUIRED
153 *
154 * */
155export declare const NETWORK_AUTHENTICATION_REQUIRED = 511;
156/**
157 * @deprecated Please use StatusCodes.NO_CONTENT
158 *
159 * */
160export declare const NO_CONTENT = 204;
161/**
162 * @deprecated Please use StatusCodes.NON_AUTHORITATIVE_INFORMATION
163 *
164 * */
165export declare const NON_AUTHORITATIVE_INFORMATION = 203;
166/**
167 * @deprecated Please use StatusCodes.NOT_ACCEPTABLE
168 *
169 * */
170export declare const NOT_ACCEPTABLE = 406;
171/**
172 * @deprecated Please use StatusCodes.NOT_FOUND
173 *
174 * */
175export declare const NOT_FOUND = 404;
176/**
177 * @deprecated Please use StatusCodes.NOT_IMPLEMENTED
178 *
179 * */
180export declare const NOT_IMPLEMENTED = 501;
181/**
182 * @deprecated Please use StatusCodes.NOT_MODIFIED
183 *
184 * */
185export declare const NOT_MODIFIED = 304;
186/**
187 * @deprecated Please use StatusCodes.OK
188 *
189 * */
190export declare const OK = 200;
191/**
192 * @deprecated Please use StatusCodes.PARTIAL_CONTENT
193 *
194 * */
195export declare const PARTIAL_CONTENT = 206;
196/**
197 * @deprecated Please use StatusCodes.PAYMENT_REQUIRED
198 *
199 * */
200export declare const PAYMENT_REQUIRED = 402;
201/**
202 * @deprecated Please use StatusCodes.PERMANENT_REDIRECT
203 *
204 * */
205export declare const PERMANENT_REDIRECT = 308;
206/**
207 * @deprecated Please use StatusCodes.PRECONDITION_FAILED
208 *
209 * */
210export declare const PRECONDITION_FAILED = 412;
211/**
212 * @deprecated Please use StatusCodes.PRECONDITION_REQUIRED
213 *
214 * */
215export declare const PRECONDITION_REQUIRED = 428;
216/**
217 * @deprecated Please use StatusCodes.PROCESSING
218 *
219 * */
220export declare const PROCESSING = 102;
221/**
222 * @deprecated Please use StatusCodes.PROXY_AUTHENTICATION_REQUIRED
223 *
224 * */
225export declare const PROXY_AUTHENTICATION_REQUIRED = 407;
226/**
227 * @deprecated Please use StatusCodes.REQUEST_HEADER_FIELDS_TOO_LARGE
228 *
229 * */
230export declare const REQUEST_HEADER_FIELDS_TOO_LARGE = 431;
231/**
232 * @deprecated Please use StatusCodes.REQUEST_TIMEOUT
233 *
234 * */
235export declare const REQUEST_TIMEOUT = 408;
236/**
237 * @deprecated Please use StatusCodes.REQUEST_TOO_LONG
238 *
239 * */
240export declare const REQUEST_TOO_LONG = 413;
241/**
242 * @deprecated Please use StatusCodes.REQUEST_URI_TOO_LONG
243 *
244 * */
245export declare const REQUEST_URI_TOO_LONG = 414;
246/**
247 * @deprecated Please use StatusCodes.REQUESTED_RANGE_NOT_SATISFIABLE
248 *
249 * */
250export declare const REQUESTED_RANGE_NOT_SATISFIABLE = 416;
251/**
252 * @deprecated Please use StatusCodes.RESET_CONTENT
253 *
254 * */
255export declare const RESET_CONTENT = 205;
256/**
257 * @deprecated Please use StatusCodes.SEE_OTHER
258 *
259 * */
260export declare const SEE_OTHER = 303;
261/**
262 * @deprecated Please use StatusCodes.SERVICE_UNAVAILABLE
263 *
264 * */
265export declare const SERVICE_UNAVAILABLE = 503;
266/**
267 * @deprecated Please use StatusCodes.SWITCHING_PROTOCOLS
268 *
269 * */
270export declare const SWITCHING_PROTOCOLS = 101;
271/**
272 * @deprecated Please use StatusCodes.TEMPORARY_REDIRECT
273 *
274 * */
275export declare const TEMPORARY_REDIRECT = 307;
276/**
277 * @deprecated Please use StatusCodes.TOO_MANY_REQUESTS
278 *
279 * */
280export declare const TOO_MANY_REQUESTS = 429;
281/**
282 * @deprecated Please use StatusCodes.UNAUTHORIZED
283 *
284 * */
285export declare const UNAUTHORIZED = 401;
286/**
287 * @deprecated Please use StatusCodes.UNPROCESSABLE_ENTITY
288 *
289 * */
290export declare const UNPROCESSABLE_ENTITY = 422;
291/**
292 * @deprecated Please use StatusCodes.UNSUPPORTED_MEDIA_TYPE
293 *
294 * */
295export declare const UNSUPPORTED_MEDIA_TYPE = 415;
296/**
297 * @deprecated Please use StatusCodes.USE_PROXY
298 *
299 * */
300export declare const USE_PROXY = 305;
301export declare enum StatusCodes {
302 /**
303 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.3
304 *
305 * The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing.
306 */
307 ACCEPTED = 202,
308 /**
309 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.3
310 *
311 * This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.
312 */
313 BAD_GATEWAY = 502,
314 /**
315 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.1
316 *
317 * This response means that server could not understand the request due to invalid syntax.
318 */
319 BAD_REQUEST = 400,
320 /**
321 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.8
322 *
323 * This response is sent when a request conflicts with the current state of the server.
324 */
325 CONFLICT = 409,
326 /**
327 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1
328 *
329 * This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.
330 */
331 CONTINUE = 100,
332 /**
333 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.2
334 *
335 * The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.
336 */
337 CREATED = 201,
338 /**
339 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.14
340 *
341 * This response code means the expectation indicated by the Expect request header field can't be met by the server.
342 */
343 EXPECTATION_FAILED = 417,
344 /**
345 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.5
346 *
347 * The request failed due to failure of a previous request.
348 */
349 FAILED_DEPENDENCY = 424,
350 /**
351 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.3
352 *
353 * The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike 401, the client's identity is known to the server.
354 */
355 FORBIDDEN = 403,
356 /**
357 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.5
358 *
359 * This error response is given when the server is acting as a gateway and cannot get a response in time.
360 */
361 GATEWAY_TIMEOUT = 504,
362 /**
363 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.9
364 *
365 * This response would be sent when the requested content has been permenantly deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for "limited-time, promotional services". APIs should not feel compelled to indicate resources that have been deleted with this status code.
366 */
367 GONE = 410,
368 /**
369 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.6
370 *
371 * The HTTP version used in the request is not supported by the server.
372 */
373 HTTP_VERSION_NOT_SUPPORTED = 505,
374 /**
375 * Official Documentation @ https://tools.ietf.org/html/rfc2324#section-2.3.2
376 *
377 * Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout.
378 */
379 IM_A_TEAPOT = 418,
380 /**
381 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6
382 *
383 * The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request which received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action.
384 */
385 INSUFFICIENT_SPACE_ON_RESOURCE = 419,
386 /**
387 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6
388 *
389 * The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.
390 */
391 INSUFFICIENT_STORAGE = 507,
392 /**
393 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.1
394 *
395 * The server encountered an unexpected condition that prevented it from fulfilling the request.
396 */
397 INTERNAL_SERVER_ERROR = 500,
398 /**
399 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.10
400 *
401 * The server rejected the request because the Content-Length header field is not defined and the server requires it.
402 */
403 LENGTH_REQUIRED = 411,
404 /**
405 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.4
406 *
407 * The resource that is being accessed is locked.
408 */
409 LOCKED = 423,
410 /**
411 * @deprecated
412 * Official Documentation @ https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt
413 *
414 * A deprecated response used by the Spring Framework when a method has failed.
415 */
416 METHOD_FAILURE = 420,
417 /**
418 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.5
419 *
420 * The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code.
421 */
422 METHOD_NOT_ALLOWED = 405,
423 /**
424 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.2
425 *
426 * This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response.
427 */
428 MOVED_PERMANENTLY = 301,
429 /**
430 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.3
431 *
432 * This response code means that URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.
433 */
434 MOVED_TEMPORARILY = 302,
435 /**
436 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.2
437 *
438 * A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate.
439 */
440 MULTI_STATUS = 207,
441 /**
442 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.1
443 *
444 * The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses.
445 */
446 MULTIPLE_CHOICES = 300,
447 /**
448 * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-6
449 *
450 * The 511 status code indicates that the client needs to authenticate to gain network access.
451 */
452 NETWORK_AUTHENTICATION_REQUIRED = 511,
453 /**
454 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.5
455 *
456 * There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.
457 */
458 NO_CONTENT = 204,
459 /**
460 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.4
461 *
462 * This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response.
463 */
464 NON_AUTHORITATIVE_INFORMATION = 203,
465 /**
466 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.6
467 *
468 * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent.
469 */
470 NOT_ACCEPTABLE = 406,
471 /**
472 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.4
473 *
474 * The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurence on the web.
475 */
476 NOT_FOUND = 404,
477 /**
478 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2
479 *
480 * The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.
481 */
482 NOT_IMPLEMENTED = 501,
483 /**
484 * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.1
485 *
486 * This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.
487 */
488 NOT_MODIFIED = 304,
489 /**
490 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1
491 *
492 * The request has succeeded. The meaning of a success varies depending on the HTTP method:
493 * GET: The resource has been fetched and is transmitted in the message body.
494 * HEAD: The entity headers are in the message body.
495 * POST: The resource describing the result of the action is transmitted in the message body.
496 * TRACE: The message body contains the request message as received by the server
497 */
498 OK = 200,
499 /**
500 * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.1
501 *
502 * This response code is used because of range header sent by the client to separate download into multiple streams.
503 */
504 PARTIAL_CONTENT = 206,
505 /**
506 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.2
507 *
508 * This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently.
509 */
510 PAYMENT_REQUIRED = 402,
511 /**
512 * Official Documentation @ https://tools.ietf.org/html/rfc7538#section-3
513 *
514 * This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.
515 */
516 PERMANENT_REDIRECT = 308,
517 /**
518 * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.2
519 *
520 * The client has indicated preconditions in its headers which the server does not meet.
521 */
522 PRECONDITION_FAILED = 412,
523 /**
524 * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-3
525 *
526 * The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.
527 */
528 PRECONDITION_REQUIRED = 428,
529 /**
530 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.1
531 *
532 * This code indicates that the server has received and is processing the request, but no response is available yet.
533 */
534 PROCESSING = 102,
535 /**
536 * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.2
537 *
538 * This is similar to 401 but authentication is needed to be done by a proxy.
539 */
540 PROXY_AUTHENTICATION_REQUIRED = 407,
541 /**
542 * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-5
543 *
544 * The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.
545 */
546 REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
547 /**
548 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.7
549 *
550 * This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.
551 */
552 REQUEST_TIMEOUT = 408,
553 /**
554 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.11
555 *
556 * Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.
557 */
558 REQUEST_TOO_LONG = 413,
559 /**
560 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.12
561 *
562 * The URI requested by the client is longer than the server is willing to interpret.
563 */
564 REQUEST_URI_TOO_LONG = 414,
565 /**
566 * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.4
567 *
568 * The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data.
569 */
570 REQUESTED_RANGE_NOT_SATISFIABLE = 416,
571 /**
572 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.6
573 *
574 * This response code is sent after accomplishing request to tell user agent reset document view which sent this request.
575 */
576 RESET_CONTENT = 205,
577 /**
578 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.4
579 *
580 * Server sent this response to directing client to get requested resource to another URI with an GET request.
581 */
582 SEE_OTHER = 303,
583 /**
584 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.4
585 *
586 * The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.
587 */
588 SERVICE_UNAVAILABLE = 503,
589 /**
590 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.2
591 *
592 * This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too.
593 */
594 SWITCHING_PROTOCOLS = 101,
595 /**
596 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.7
597 *
598 * Server sent this response to directing client to get requested resource to another URI with same method that used prior request. This has the same semantic than the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.
599 */
600 TEMPORARY_REDIRECT = 307,
601 /**
602 * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-4
603 *
604 * The user has sent too many requests in a given amount of time ("rate limiting").
605 */
606 TOO_MANY_REQUESTS = 429,
607 /**
608 * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.1
609 *
610 * Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.
611 */
612 UNAUTHORIZED = 401,
613 /**
614 * Official Documentation @ https://tools.ietf.org/html/rfc7725
615 *
616 * The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.
617 */
618 UNAVAILABLE_FOR_LEGAL_REASONS = 451,
619 /**
620 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.3
621 *
622 * The request was well-formed but was unable to be followed due to semantic errors.
623 */
624 UNPROCESSABLE_ENTITY = 422,
625 /**
626 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.13
627 *
628 * The media format of the requested data is not supported by the server, so the server is rejecting the request.
629 */
630 UNSUPPORTED_MEDIA_TYPE = 415,
631 /**
632 * @deprecated
633 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.6
634 *
635 * Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.
636 */
637 USE_PROXY = 305
638}
639export declare enum ReasonPhrases {
640 /**
641 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.3
642 *
643 * The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing.
644 */
645 ACCEPTED = "Accepted",
646 /**
647 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.3
648 *
649 * This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.
650 */
651 BAD_GATEWAY = "Bad Gateway",
652 /**
653 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.1
654 *
655 * This response means that server could not understand the request due to invalid syntax.
656 */
657 BAD_REQUEST = "Bad Request",
658 /**
659 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.8
660 *
661 * This response is sent when a request conflicts with the current state of the server.
662 */
663 CONFLICT = "Conflict",
664 /**
665 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1
666 *
667 * This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.
668 */
669 CONTINUE = "Continue",
670 /**
671 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.2
672 *
673 * The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.
674 */
675 CREATED = "Created",
676 /**
677 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.14
678 *
679 * This response code means the expectation indicated by the Expect request header field can't be met by the server.
680 */
681 EXPECTATION_FAILED = "Expectation Failed",
682 /**
683 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.5
684 *
685 * The request failed due to failure of a previous request.
686 */
687 FAILED_DEPENDENCY = "Failed Dependency",
688 /**
689 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.3
690 *
691 * The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike 401, the client's identity is known to the server.
692 */
693 FORBIDDEN = "Forbidden",
694 /**
695 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.5
696 *
697 * This error response is given when the server is acting as a gateway and cannot get a response in time.
698 */
699 GATEWAY_TIMEOUT = "Gateway Timeout",
700 /**
701 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.9
702 *
703 * This response would be sent when the requested content has been permenantly deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for "limited-time, promotional services". APIs should not feel compelled to indicate resources that have been deleted with this status code.
704 */
705 GONE = "Gone",
706 /**
707 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.6
708 *
709 * The HTTP version used in the request is not supported by the server.
710 */
711 HTTP_VERSION_NOT_SUPPORTED = "HTTP Version Not Supported",
712 /**
713 * Official Documentation @ https://tools.ietf.org/html/rfc2324#section-2.3.2
714 *
715 * Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout.
716 */
717 IM_A_TEAPOT = "I'm a teapot",
718 /**
719 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6
720 *
721 * The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request which received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action.
722 */
723 INSUFFICIENT_SPACE_ON_RESOURCE = "Insufficient Space on Resource",
724 /**
725 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6
726 *
727 * The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.
728 */
729 INSUFFICIENT_STORAGE = "Insufficient Storage",
730 /**
731 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.1
732 *
733 * The server encountered an unexpected condition that prevented it from fulfilling the request.
734 */
735 INTERNAL_SERVER_ERROR = "Internal Server Error",
736 /**
737 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.10
738 *
739 * The server rejected the request because the Content-Length header field is not defined and the server requires it.
740 */
741 LENGTH_REQUIRED = "Length Required",
742 /**
743 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.4
744 *
745 * The resource that is being accessed is locked.
746 */
747 LOCKED = "Locked",
748 /**
749 * @deprecated
750 * Official Documentation @ https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt
751 *
752 * A deprecated response used by the Spring Framework when a method has failed.
753 */
754 METHOD_FAILURE = "Method Failure",
755 /**
756 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.5
757 *
758 * The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code.
759 */
760 METHOD_NOT_ALLOWED = "Method Not Allowed",
761 /**
762 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.2
763 *
764 * This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response.
765 */
766 MOVED_PERMANENTLY = "Moved Permanently",
767 /**
768 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.3
769 *
770 * This response code means that URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.
771 */
772 MOVED_TEMPORARILY = "Moved Temporarily",
773 /**
774 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.2
775 *
776 * A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate.
777 */
778 MULTI_STATUS = "Multi-Status",
779 /**
780 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.1
781 *
782 * The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses.
783 */
784 MULTIPLE_CHOICES = "Multiple Choices",
785 /**
786 * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-6
787 *
788 * The 511 status code indicates that the client needs to authenticate to gain network access.
789 */
790 NETWORK_AUTHENTICATION_REQUIRED = "Network Authentication Required",
791 /**
792 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.5
793 *
794 * There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.
795 */
796 NO_CONTENT = "No Content",
797 /**
798 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.4
799 *
800 * This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response.
801 */
802 NON_AUTHORITATIVE_INFORMATION = "Non Authoritative Information",
803 /**
804 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.6
805 *
806 * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent.
807 */
808 NOT_ACCEPTABLE = "Not Acceptable",
809 /**
810 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.4
811 *
812 * The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurence on the web.
813 */
814 NOT_FOUND = "Not Found",
815 /**
816 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2
817 *
818 * The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.
819 */
820 NOT_IMPLEMENTED = "Not Implemented",
821 /**
822 * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.1
823 *
824 * This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.
825 */
826 NOT_MODIFIED = "Not Modified",
827 /**
828 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1
829 *
830 * The request has succeeded. The meaning of a success varies depending on the HTTP method:
831 * GET: The resource has been fetched and is transmitted in the message body.
832 * HEAD: The entity headers are in the message body.
833 * POST: The resource describing the result of the action is transmitted in the message body.
834 * TRACE: The message body contains the request message as received by the server
835 */
836 OK = "OK",
837 /**
838 * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.1
839 *
840 * This response code is used because of range header sent by the client to separate download into multiple streams.
841 */
842 PARTIAL_CONTENT = "Partial Content",
843 /**
844 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.2
845 *
846 * This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently.
847 */
848 PAYMENT_REQUIRED = "Payment Required",
849 /**
850 * Official Documentation @ https://tools.ietf.org/html/rfc7538#section-3
851 *
852 * This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.
853 */
854 PERMANENT_REDIRECT = "Permanent Redirect",
855 /**
856 * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.2
857 *
858 * The client has indicated preconditions in its headers which the server does not meet.
859 */
860 PRECONDITION_FAILED = "Precondition Failed",
861 /**
862 * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-3
863 *
864 * The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.
865 */
866 PRECONDITION_REQUIRED = "Precondition Required",
867 /**
868 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.1
869 *
870 * This code indicates that the server has received and is processing the request, but no response is available yet.
871 */
872 PROCESSING = "Processing",
873 /**
874 * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.2
875 *
876 * This is similar to 401 but authentication is needed to be done by a proxy.
877 */
878 PROXY_AUTHENTICATION_REQUIRED = "Proxy Authentication Required",
879 /**
880 * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-5
881 *
882 * The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.
883 */
884 REQUEST_HEADER_FIELDS_TOO_LARGE = "Request Header Fields Too Large",
885 /**
886 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.7
887 *
888 * This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.
889 */
890 REQUEST_TIMEOUT = "Request Timeout",
891 /**
892 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.11
893 *
894 * Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.
895 */
896 REQUEST_TOO_LONG = "Request Entity Too Large",
897 /**
898 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.12
899 *
900 * The URI requested by the client is longer than the server is willing to interpret.
901 */
902 REQUEST_URI_TOO_LONG = "Request-URI Too Long",
903 /**
904 * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.4
905 *
906 * The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data.
907 */
908 REQUESTED_RANGE_NOT_SATISFIABLE = "Requested Range Not Satisfiable",
909 /**
910 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.6
911 *
912 * This response code is sent after accomplishing request to tell user agent reset document view which sent this request.
913 */
914 RESET_CONTENT = "Reset Content",
915 /**
916 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.4
917 *
918 * Server sent this response to directing client to get requested resource to another URI with an GET request.
919 */
920 SEE_OTHER = "See Other",
921 /**
922 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.4
923 *
924 * The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.
925 */
926 SERVICE_UNAVAILABLE = "Service Unavailable",
927 /**
928 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.2
929 *
930 * This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too.
931 */
932 SWITCHING_PROTOCOLS = "Switching Protocols",
933 /**
934 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.7
935 *
936 * Server sent this response to directing client to get requested resource to another URI with same method that used prior request. This has the same semantic than the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.
937 */
938 TEMPORARY_REDIRECT = "Temporary Redirect",
939 /**
940 * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-4
941 *
942 * The user has sent too many requests in a given amount of time ("rate limiting").
943 */
944 TOO_MANY_REQUESTS = "Too Many Requests",
945 /**
946 * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.1
947 *
948 * Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.
949 */
950 UNAUTHORIZED = "Unauthorized",
951 /**
952 * Official Documentation @ https://tools.ietf.org/html/rfc7725
953 *
954 * The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.
955 */
956 UNAVAILABLE_FOR_LEGAL_REASONS = "Unavailable For Legal Reasons",
957 /**
958 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.3
959 *
960 * The request was well-formed but was unable to be followed due to semantic errors.
961 */
962 UNPROCESSABLE_ENTITY = "Unprocessable Entity",
963 /**
964 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.13
965 *
966 * The media format of the requested data is not supported by the server, so the server is rejecting the request.
967 */
968 UNSUPPORTED_MEDIA_TYPE = "Unsupported Media Type",
969 /**
970 * @deprecated
971 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.6
972 *
973 * Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.
974 */
975 USE_PROXY = "Use Proxy"
976}
977export declare const statusCodeToReasonPhrase: Record<string, string>;
978export declare const reasonPhraseToStatusCode: Record<string, number>;