Skip to content
File

Blob: src/node/internal/internal_http_constants.ts

typescript109 lines
1// Copyright (c) 2017-2022 Cloudflare, Inc.
2// Licensed under the Apache 2.0 license found in the LICENSE file or at:
3// https://opensource.org/licenses/Apache-2.0
4// Copyright Joyent and Node contributors. All rights reserved. MIT license.
5 
6export const METHODS = [
7 'ACL',
8 'BIND',
9 'CHECKOUT',
10 'CONNECT',
11 'COPY',
12 'DELETE',
13 'GET',
14 'HEAD',
15 'LINK',
16 'LOCK',
17 'M-SEARCH',
18 'MERGE',
19 'MKACTIVITY',
20 'MKCALENDAR',
21 'MKCOL',
22 'MOVE',
23 'NOTIFY',
24 'OPTIONS',
25 'PATCH',
26 'POST',
27 'PROPFIND',
28 'PROPPATCH',
29 'PURGE',
30 'PUT',
31 'QUERY',
32 'REBIND',
33 'REPORT',
34 'SEARCH',
35 'SOURCE',
36 'SUBSCRIBE',
37 'TRACE',
38 'UNBIND',
39 'UNLINK',
40 'UNLOCK',
41 'UNSUBSCRIBE',
42].toSorted();
43 
44export const STATUS_CODES: Record<string, string> = {
45 '100': 'Continue',
46 '101': 'Switching Protocols',
47 '102': 'Processing',
48 '103': 'Early Hints',
49 '200': 'OK',
50 '201': 'Created',
51 '202': 'Accepted',
52 '203': 'Non-Authoritative Information',
53 '204': 'No Content',
54 '205': 'Reset Content',
55 '206': 'Partial Content',
56 '207': 'Multi-Status',
57 '208': 'Already Reported',
58 '226': 'IM Used',
59 '300': 'Multiple Choices',
60 '301': 'Moved Permanently',
61 '302': 'Found',
62 '303': 'See Other',
63 '304': 'Not Modified',
64 '305': 'Use Proxy',
65 '307': 'Temporary Redirect',
66 '308': 'Permanent Redirect',
67 '400': 'Bad Request',
68 '401': 'Unauthorized',
69 '402': 'Payment Required',
70 '403': 'Forbidden',
71 '404': 'Not Found',
72 '405': 'Method Not Allowed',
73 '406': 'Not Acceptable',
74 '407': 'Proxy Authentication Required',
75 '408': 'Request Timeout',
76 '409': 'Conflict',
77 '410': 'Gone',
78 '411': 'Length Required',
79 '412': 'Precondition Failed',
80 '413': 'Payload Too Large',
81 '414': 'URI Too Long',
82 '415': 'Unsupported Media Type',
83 '416': 'Range Not Satisfiable',
84 '417': 'Expectation Failed',
85 '418': "I'm a Teapot",
86 '421': 'Misdirected Request',
87 '422': 'Unprocessable Entity',
88 '423': 'Locked',
89 '424': 'Failed Dependency',
90 '425': 'Too Early',
91 '426': 'Upgrade Required',
92 '428': 'Precondition Required',
93 '429': 'Too Many Requests',
94 '431': 'Request Header Fields Too Large',
95 '451': 'Unavailable For Legal Reasons',
96 '500': 'Internal Server Error',
97 '501': 'Not Implemented',
98 '502': 'Bad Gateway',
99 '503': 'Service Unavailable',
100 '504': 'Gateway Timeout',
101 '505': 'HTTP Version Not Supported',
102 '506': 'Variant Also Negotiates',
103 '507': 'Insufficient Storage',
104 '508': 'Loop Detected',
105 '509': 'Bandwidth Limit Exceeded',
106 '510': 'Not Extended',
107 '511': 'Network Authentication Required',
108};