@d1g1tal/transportr 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,274 @@
1
+ /**
2
+ * Defining a constant object with the name HttpRequestMethod.
3
+ */
4
+ declare const HttpRequestMethod: {
5
+ /**
6
+ * The OPTIONS method represents a request for information about the communication options available on the
7
+ * request/response chain identified by the Request-URI. This method allows the client to determine the options and/or
8
+ * requirements associated with a resource, or the capabilities of a server, without implying a resource action or
9
+ * initiating a resource retrieval.
10
+ *
11
+ * Responses to this method are not cacheable.
12
+ *
13
+ * If the OPTIONS request includes an entity-body (as indicated by the presence of Content-Length or
14
+ * Transfer-Encoding), then the media type MUST be indicated by a Content-Type field. Although this specification does
15
+ * not define any use for such a body, future extensions to HTTP might use the OPTIONS body to make more detailed
16
+ * queries on the server. A server that does not support such an extension MAY discard the request body.
17
+ *
18
+ * If the Request-URI is an asterisk ("*"), the OPTIONS request is intended to apply to the server in general rather
19
+ * than to a specific resource. Since a server's communication options typically depend on the resource, the "*"
20
+ * request is only useful as a "ping" or "no-op" type of method, it does nothing beyond allowing the client to test the
21
+ * capabilities of the server. For example, this can be used to test a proxy for HTTP/1.1 compliance (or lack thereof).
22
+ *
23
+ * If the Request-URI is not an asterisk, the OPTIONS request applies only to the options that are available when
24
+ * communicating with that resource.
25
+ *
26
+ * A 200 response SHOULD include any header fields that indicate optional features implemented by the server and
27
+ * applicable to that resource (e.g., Allow), possibly including extensions not defined by this specification. The
28
+ * response body, if any, SHOULD also include information about the communication options. The format for such a body
29
+ * is not defined by this specification, but might be defined by future extensions to HTTP. Content negotiation MAY be
30
+ * used to select the appropriate response format. If no response body is included, the response MUST include a
31
+ * Content-Length field with a field-value of "0".
32
+ *
33
+ * The Max-Forwards request-header field MAY be used to target a specific proxy in the request chain. When a proxy
34
+ * receives an OPTIONS request on an absoluteURI for which request forwarding is permitted, the proxy MUST check for a
35
+ * Max-Forwards field. If the Max-Forwards field-value is zero ("0"), the proxy MUST NOT forward the message, instead,
36
+ * the proxy SHOULD respond with its own communication options. If the Max-Forwards field-value is an integer greater
37
+ * than zero, the proxy MUST decrement the field-value when it forwards the request. If no Max-Forwards field is
38
+ * present in the request, then the forwarded request MUST NOT include a Max-Forwards field.
39
+ */
40
+ readonly OPTIONS: "OPTIONS";
41
+ /**
42
+ * The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If
43
+ * the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in
44
+ * the response and not the source text of the process, unless that text happens to be the output of the process.
45
+ *
46
+ * The semantics of the GET method change to a "conditional GET" if the request message includes an If-Modified-Since;
47
+ * If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. A conditional GET method requests that the
48
+ * entity be transferred only under the circumstances described by the conditional header field(s). The conditional GET
49
+ * method is intended to reduce unnecessary network usage by allowing cached entities to be refreshed without requiring
50
+ * multiple requests or transferring data already held by the client.
51
+ *
52
+ * The semantics of the GET method change to a "partial GET" if the request message includes a Range header field. A
53
+ * partial GET requests that only part of the entity be transferred, as described in section 14.35. The partial GET
54
+ * method is intended to reduce unnecessary network usage by allowing partially-retrieved entities to be completed
55
+ * without transferring data already held by the client.
56
+ *
57
+ * The response to a GET request is cacheable if and only if it meets the requirements for HTTP caching described in
58
+ * section 13.
59
+ *
60
+ * See section 15.1.3 for security considerations when used for forms.
61
+ */
62
+ readonly GET: "GET";
63
+ /**
64
+ * The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The
65
+ * meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information
66
+ * sent in response to a GET request. This method can be used for obtaining meta information about the entity implied by
67
+ * the request without transferring the entity-body itself. This method is often used for testing hypertext links for
68
+ * validity, accessibility, and recent modification.
69
+ *
70
+ * The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY be
71
+ * used to update a previously cached entity from that resource. If the new field values indicate that the cached
72
+ * entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or
73
+ * Last-Modified), then the cache MUST treat the cache entry as stale.
74
+ */
75
+ readonly HEAD: "HEAD";
76
+ /**
77
+ * The POST method is used to request that the origin server accept the entity enclosed in the request as a new
78
+ * subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform
79
+ * method to cover the following functions:
80
+ * <ul>
81
+ * <li>Annotation of existing resources,</li>
82
+ * <li>Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles,</li>
83
+ * <li>Providing a block of data, such as the result of submitting a form, to a data-handling process,</li>
84
+ * <li>Extending a database through an append operation.</li>
85
+ * </ul>
86
+ *
87
+ * The actual function performed by the POST method is determined by the server and is usually dependent on the
88
+ * Request-URI. The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory
89
+ * containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a
90
+ * database.
91
+ *
92
+ * The action performed by the POST method might not result in a resource that can be identified by a URI. In this
93
+ * case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the
94
+ * response includes an entity that describes the result.
95
+ *
96
+ * If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity
97
+ * which describes the status of the request and refers to the new resource, and a Location header (see section 14.30).
98
+ *
99
+ * Responses to this method are not cacheable, unless the response includes appropriate Cache-Control or Expires header
100
+ * fields. However, the 303 (See Other) response can be used to direct the user agent to retrieve a cacheable resource.
101
+ *
102
+ * POST requests MUST obey the message transmission requirements set out in section 8.2.
103
+ *
104
+ * See section 15.1.3 for security considerations.
105
+ */
106
+ readonly POST: "POST";
107
+ /**
108
+ * The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers
109
+ * to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing
110
+ * on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being
111
+ * defined as a new resource by the requesting user agent, the origin server can create the resource with that URI. If
112
+ * a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. If an
113
+ * existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate
114
+ * successful completion of the request. If the resource could not be created or modified with the Request-URI, an
115
+ * appropriate error response SHOULD be given that reflects the nature of the problem. The recipient of the entity MUST
116
+ * \NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a
117
+ * 501 (Not Implemented) response in such cases.
118
+ *
119
+ * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those
120
+ * entries SHOULD be treated as stale. Responses to this method are not cacheable.
121
+ *
122
+ * The fundamental difference between the POST and PUT requests is reflected in the different meaning of the
123
+ * Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource
124
+ * might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations.
125
+ * In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what
126
+ * URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires
127
+ * that the request be applied to a different URI, it MUST send a 301 (Moved Permanently) response, the user agent MAY
128
+ * then make its own decision regarding whether or not to redirect the request.
129
+ *
130
+ * A single resource MAY be identified by many different URIs. For example, an article might have a URI for identifying
131
+ * "the current version" which is separate from the URI identifying each particular version. In this case, a PUT
132
+ * request on a general URI might result in several other URIs being defined by the origin server.
133
+ *
134
+ * HTTP/1.1 does not define how a PUT method affects the state of an origin server.
135
+ *
136
+ * PUT requests MUST obey the message transmission requirements set out in section 8.2.
137
+ *
138
+ * Unless otherwise specified for a particular entity-header, the entity-headers in the PUT request SHOULD be applied
139
+ * to the resource created or modified by the PUT.
140
+ */
141
+ readonly PUT: "PUT";
142
+ /**
143
+ * The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY
144
+ * be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the
145
+ * operation has been carried out, even if the status code returned from the origin server indicates that the action
146
+ * has been completed successfully. However, the server SHOULD NOT indicate success unless, at the time the response
147
+ * is given, it intends to delete the resource or move it to an inaccessible location.
148
+ *
149
+ * A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if
150
+ * the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not
151
+ * include an entity.
152
+ *
153
+ * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those
154
+ * entries SHOULD be treated as stale. Responses to this method are not cacheable.
155
+ */
156
+ readonly DELETE: "DELETE";
157
+ /**
158
+ * The TRACE method is used to invoke a remote, application-layer loop- back of the request message. The final
159
+ * recipient of the request SHOULD reflect the message received back to the client as the entity-body of a 200 (OK)
160
+ * response. The final recipient is either the origin server or the first proxy or gateway to receive a Max-Forwards
161
+ * value of zero (0) in the request (see section 14.31). A TRACE request MUST NOT include an entity.
162
+ *
163
+ * TRACE allows the client to see what is being received at the other end of the request chain and use that data for
164
+ * testing or diagnostic information. The value of the Via header field (section 14.45) is of particular interest,
165
+ * since it acts as a trace of the request chain. Use of the Max-Forwards header field allows the client to limit the
166
+ * length of the request chain, which is useful for testing a chain of proxies forwarding messages in an infinite loop.
167
+ *
168
+ * If the request is valid, the response SHOULD contain the entire request message in the entity-body, with a
169
+ * Content-Type of "message/http". Responses to this method MUST NOT be cached.
170
+ */
171
+ readonly TRACE: "TRACE";
172
+ /**
173
+ * This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a
174
+ * tunnel (e.g. SSL tunneling [44]).
175
+ */
176
+ readonly CONNECT: "CONNECT";
177
+ /**
178
+ * The PATCH method requests that a set of changes described in the
179
+ * request entity be applied to the resource identified by the Request-
180
+ * URI. The set of changes is represented in a format called a "patch
181
+ * document" identified by a media type. If the Request-URI does not
182
+ * point to an existing resource, the server MAY create a new resource,
183
+ * depending on the patch document type (whether it can logically modify
184
+ * a null resource) and permissions, etc.
185
+ *
186
+ * The difference between the PUT and PATCH requests is reflected in the
187
+ * way the server processes the enclosed entity to modify the resource
188
+ * identified by the Request-URI. In a PUT request, the enclosed entity
189
+ * is considered to be a modified version of the resource stored on the
190
+ * origin server, and the client is requesting that the stored version
191
+ * be replaced. With PATCH, however, the enclosed entity contains a set
192
+ * of instructions describing how a resource currently residing on the
193
+ * origin server should be modified to produce a new version. The PATCH
194
+ * method affects the resource identified by the Request-URI, and it
195
+ * also MAY have side effects on other resources; i.e., new resources
196
+ * may be created, or existing ones modified, by the application of a
197
+ * PATCH.
198
+ *
199
+ * PATCH is neither safe nor idempotent as defined by [RFC2616], Section
200
+ * 9.1.
201
+ *
202
+ * A PATCH request can be issued in such a way as to be idempotent,
203
+ * which also helps prevent bad outcomes from collisions between two
204
+ * PATCH requests on the same resource in a similar time frame.
205
+ * Collisions from multiple PATCH requests may be more dangerous than
206
+ * PUT collisions because some patch formats need to operate from a
207
+ * known base-point or else they will corrupt the resource. Clients
208
+ * using this kind of patch application SHOULD use a conditional request
209
+ * such that the request will fail if the resource has been updated
210
+ * since the client last accessed the resource. For example, the client
211
+ * can use a strong ETag [RFC2616] in an If-Match header on the PATCH
212
+ * request.
213
+ *
214
+ * There are also cases where patch formats do not need to operate from
215
+ * a known base-point (e.g., appending text lines to log files, or non-
216
+ * colliding rows to database tables), in which case the same care in
217
+ * client requests is not needed.
218
+ *
219
+ * The server MUST apply the entire set of changes atomically and never
220
+ * provide (e.g., in response to a GET during this operation) a
221
+ * partially modified representation. If the entire patch document
222
+ * cannot be successfully applied, then the server MUST NOT apply any of
223
+ * the changes. The determination of what constitutes a successful
224
+ * PATCH can vary depending on the patch document and the type of
225
+ * resource(s) being modified. For example, the common 'diff' utility
226
+ * can generate a patch document that applies to multiple files in a
227
+ * directory hierarchy. The atomicity requirement holds for all
228
+ * directly affected files. See "Error Handling", Section 2.2, for
229
+ * details on status codes and possible error conditions.
230
+ *
231
+ * If the request passes through a cache and the Request-URI identifies
232
+ * one or more currently cached entities, those entries SHOULD be
233
+ * treated as stale. A response to this method is only cacheable if it
234
+ * contains explicit freshness information (such as an Expires header or
235
+ * "Cache-Control: max-age" directive) as well as the Content-Location
236
+ * header matching the Request-URI, indicating that the PATCH response
237
+ * body is a resource representation. A cached PATCH response can only
238
+ * be used to respond to subsequent GET and HEAD requests; it MUST NOT
239
+ * be used to respond to other methods (in particular, PATCH).
240
+ *
241
+ * Note that entity-headers contained in the request apply only to the
242
+ * contained patch document and MUST NOT be applied to the resource
243
+ * being modified. Thus, a Content-Language header could be present on
244
+ * the request, but it would only mean (for whatever that's worth) that
245
+ * the patch document had a language. Servers SHOULD NOT store such
246
+ * headers except as trace information, and SHOULD NOT use such header
247
+ * values the same way they might be used on PUT requests. Therefore,
248
+ * this document does not specify a way to modify a document's Content-
249
+ * Type or Content-Language value through headers, though a mechanism
250
+ * could well be designed to achieve this goal through a patch document.
251
+ *
252
+ * There is no guarantee that a resource can be modified with PATCH.
253
+ * Further, it is expected that different patch document formats will be
254
+ * appropriate for different types of resources and that no single
255
+ * format will be appropriate for all types of resources. Therefore,
256
+ * there is no single default patch document format that implementations
257
+ * are required to support. Servers MUST ensure that a received patch
258
+ * document is appropriate for the type of resource identified by the
259
+ * Request-URI.
260
+ *
261
+ * Clients need to choose when to use PATCH rather than PUT. For
262
+ * example, if the patch document size is larger than the size of the
263
+ * new resource data that would be used in a PUT, then it might make
264
+ * sense to use PUT instead of PATCH. A comparison to POST is even more
265
+ * difficult, because POST is used in widely varying ways and can
266
+ * encompass PUT and PATCH-like operations if the server chooses. If
267
+ * the operation does not modify the resource identified by the Request-
268
+ * URI in a predictable way, POST should be considered instead of PATCH
269
+ * or PUT.
270
+ */
271
+ readonly PATCH: "PATCH";
272
+ };
273
+
274
+ export { HttpRequestMethod };
@@ -0,0 +1,2 @@
1
+ var T={OPTIONS:"OPTIONS",GET:"GET",HEAD:"HEAD",POST:"POST",PUT:"PUT",DELETE:"DELETE",TRACE:"TRACE",CONNECT:"CONNECT",PATCH:"PATCH"};export{T as HttpRequestMethod};
2
+ //# sourceMappingURL=methods.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/http-request-methods.ts"],
4
+ "sourcesContent": ["/**\n * Defining a constant object with the name HttpRequestMethod.\n */\nconst HttpRequestMethod = {\n\t/**\n\t * The OPTIONS method represents a request for information about the communication options available on the\n\t * request/response chain identified by the Request-URI. This method allows the client to determine the options and/or\n\t * requirements associated with a resource, or the capabilities of a server, without implying a resource action or\n\t * initiating a resource retrieval.\n\t *\n\t * Responses to this method are not cacheable.\n\t *\n\t * If the OPTIONS request includes an entity-body (as indicated by the presence of Content-Length or\n\t * Transfer-Encoding), then the media type MUST be indicated by a Content-Type field. Although this specification does\n\t * not define any use for such a body, future extensions to HTTP might use the OPTIONS body to make more detailed\n\t * queries on the server. A server that does not support such an extension MAY discard the request body.\n\t *\n\t * If the Request-URI is an asterisk (\"*\"), the OPTIONS request is intended to apply to the server in general rather\n\t * than to a specific resource. Since a server's communication options typically depend on the resource, the \"*\"\n\t * request is only useful as a \"ping\" or \"no-op\" type of method, it does nothing beyond allowing the client to test the\n\t * capabilities of the server. For example, this can be used to test a proxy for HTTP/1.1 compliance (or lack thereof).\n\t *\n\t * If the Request-URI is not an asterisk, the OPTIONS request applies only to the options that are available when\n\t * communicating with that resource.\n\t *\n\t * A 200 response SHOULD include any header fields that indicate optional features implemented by the server and\n\t * applicable to that resource (e.g., Allow), possibly including extensions not defined by this specification. The\n\t * response body, if any, SHOULD also include information about the communication options. The format for such a body\n\t * is not defined by this specification, but might be defined by future extensions to HTTP. Content negotiation MAY be\n\t * used to select the appropriate response format. If no response body is included, the response MUST include a\n\t * Content-Length field with a field-value of \"0\".\n\t *\n\t * The Max-Forwards request-header field MAY be used to target a specific proxy in the request chain. When a proxy\n\t * receives an OPTIONS request on an absoluteURI for which request forwarding is permitted, the proxy MUST check for a\n\t * Max-Forwards field. If the Max-Forwards field-value is zero (\"0\"), the proxy MUST NOT forward the message, instead,\n\t * the proxy SHOULD respond with its own communication options. If the Max-Forwards field-value is an integer greater\n\t * than zero, the proxy MUST decrement the field-value when it forwards the request. If no Max-Forwards field is\n\t * present in the request, then the forwarded request MUST NOT include a Max-Forwards field.\n\t */\n\tOPTIONS: 'OPTIONS',\n\t/**\n\t * The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If\n\t * the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in\n\t * the response and not the source text of the process, unless that text happens to be the output of the process.\n\t *\n\t * The semantics of the GET method change to a \"conditional GET\" if the request message includes an If-Modified-Since;\n\t * If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. A conditional GET method requests that the\n\t * entity be transferred only under the circumstances described by the conditional header field(s). The conditional GET\n\t * method is intended to reduce unnecessary network usage by allowing cached entities to be refreshed without requiring\n\t * multiple requests or transferring data already held by the client.\n\t *\n\t * The semantics of the GET method change to a \"partial GET\" if the request message includes a Range header field. A\n\t * partial GET requests that only part of the entity be transferred, as described in section 14.35. The partial GET\n\t * method is intended to reduce unnecessary network usage by allowing partially-retrieved entities to be completed\n\t * without transferring data already held by the client.\n\t *\n\t * The response to a GET request is cacheable if and only if it meets the requirements for HTTP caching described in\n\t * section 13.\n\t *\n\t * See section 15.1.3 for security considerations when used for forms.\n\t */\n\tGET: 'GET',\n\t/**\n\t * The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The\n\t * meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information\n\t * sent in response to a GET request. This method can be used for obtaining meta information about the entity implied by\n\t * the request without transferring the entity-body itself. This method is often used for testing hypertext links for\n\t * validity, accessibility, and recent modification.\n\t *\n\t * The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY be\n\t * used to update a previously cached entity from that resource. If the new field values indicate that the cached\n\t * entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or\n\t * Last-Modified), then the cache MUST treat the cache entry as stale.\n\t */\n\tHEAD: 'HEAD',\n\t/**\n\t * The POST method is used to request that the origin server accept the entity enclosed in the request as a new\n\t * subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform\n\t * method to cover the following functions:\n\t * <ul>\n\t * <li>Annotation of existing resources,</li>\n\t * <li>Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles,</li>\n\t * <li>Providing a block of data, such as the result of submitting a form, to a data-handling process,</li>\n\t * <li>Extending a database through an append operation.</li>\n\t * </ul>\n\t *\n\t * The actual function performed by the POST method is determined by the server and is usually dependent on the\n\t * Request-URI. The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory\n\t * containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a\n\t * database.\n\t *\n\t * The action performed by the POST method might not result in a resource that can be identified by a URI. In this\n\t * case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the\n\t * response includes an entity that describes the result.\n\t *\n\t * If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity\n\t * which describes the status of the request and refers to the new resource, and a Location header (see section 14.30).\n\t *\n\t * Responses to this method are not cacheable, unless the response includes appropriate Cache-Control or Expires header\n\t * fields. However, the 303 (See Other) response can be used to direct the user agent to retrieve a cacheable resource.\n\t *\n\t * POST requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * See section 15.1.3 for security considerations.\n\t */\n\tPOST: 'POST',\n\t/**\n\t * The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers\n\t * to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing\n\t * on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being\n\t * defined as a new resource by the requesting user agent, the origin server can create the resource with that URI. If\n\t * a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. If an\n\t * existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate\n\t * successful completion of the request. If the resource could not be created or modified with the Request-URI, an\n\t * appropriate error response SHOULD be given that reflects the nature of the problem. The recipient of the entity MUST\n\t * \\NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a\n\t * 501 (Not Implemented) response in such cases.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t *\n\t * The fundamental difference between the POST and PUT requests is reflected in the different meaning of the\n\t * Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource\n\t * might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations.\n\t * In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what\n\t * URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires\n\t * that the request be applied to a different URI, it MUST send a 301 (Moved Permanently) response, the user agent MAY\n\t * then make its own decision regarding whether or not to redirect the request.\n\t *\n\t * A single resource MAY be identified by many different URIs. For example, an article might have a URI for identifying\n\t * \"the current version\" which is separate from the URI identifying each particular version. In this case, a PUT\n\t * request on a general URI might result in several other URIs being defined by the origin server.\n\t *\n\t * HTTP/1.1 does not define how a PUT method affects the state of an origin server.\n\t *\n\t * PUT requests MUST obey the message transmission requirements set out in section 8.2.\n\t *\n\t * Unless otherwise specified for a particular entity-header, the entity-headers in the PUT request SHOULD be applied\n\t * to the resource created or modified by the PUT.\n\t */\n\tPUT: 'PUT',\n\t/**\n\t * The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY\n\t * be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the\n\t * operation has been carried out, even if the status code returned from the origin server indicates that the action\n\t * has been completed successfully. However, the server SHOULD NOT indicate success unless, at the time the response\n\t * is given, it intends to delete the resource or move it to an inaccessible location.\n\t *\n\t * A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if\n\t * the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not\n\t * include an entity.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those\n\t * entries SHOULD be treated as stale. Responses to this method are not cacheable.\n\t */\n\tDELETE: 'DELETE',\n\t/**\n\t * The TRACE method is used to invoke a remote, application-layer loop- back of the request message. The final\n\t * recipient of the request SHOULD reflect the message received back to the client as the entity-body of a 200 (OK)\n\t * response. The final recipient is either the origin server or the first proxy or gateway to receive a Max-Forwards\n\t * value of zero (0) in the request (see section 14.31). A TRACE request MUST NOT include an entity.\n\t *\n\t * TRACE allows the client to see what is being received at the other end of the request chain and use that data for\n\t * testing or diagnostic information. The value of the Via header field (section 14.45) is of particular interest,\n\t * since it acts as a trace of the request chain. Use of the Max-Forwards header field allows the client to limit the\n\t * length of the request chain, which is useful for testing a chain of proxies forwarding messages in an infinite loop.\n\t *\n\t * If the request is valid, the response SHOULD contain the entire request message in the entity-body, with a\n\t * Content-Type of \"message/http\". Responses to this method MUST NOT be cached.\n\t */\n\tTRACE: 'TRACE',\n\t/**\n\t * This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a\n\t * tunnel (e.g. SSL tunneling [44]).\n\t */\n\tCONNECT: 'CONNECT',\n\t/**\n\t * The PATCH method requests that a set of changes described in the\n\t * request entity be applied to the resource identified by the Request-\n\t * URI. The set of changes is represented in a format called a \"patch\n\t * document\" identified by a media type. If the Request-URI does not\n\t * point to an existing resource, the server MAY create a new resource,\n\t * depending on the patch document type (whether it can logically modify\n\t * a null resource) and permissions, etc.\n\t *\n\t * The difference between the PUT and PATCH requests is reflected in the\n\t * way the server processes the enclosed entity to modify the resource\n\t * identified by the Request-URI. In a PUT request, the enclosed entity\n\t * is considered to be a modified version of the resource stored on the\n\t * origin server, and the client is requesting that the stored version\n\t * be replaced. With PATCH, however, the enclosed entity contains a set\n\t * of instructions describing how a resource currently residing on the\n\t * origin server should be modified to produce a new version. The PATCH\n\t * method affects the resource identified by the Request-URI, and it\n\t * also MAY have side effects on other resources; i.e., new resources\n\t * may be created, or existing ones modified, by the application of a\n\t * PATCH.\n\t *\n\t * PATCH is neither safe nor idempotent as defined by [RFC2616], Section\n\t * 9.1.\n\t *\n\t * A PATCH request can be issued in such a way as to be idempotent,\n\t * which also helps prevent bad outcomes from collisions between two\n\t * PATCH requests on the same resource in a similar time frame.\n\t * Collisions from multiple PATCH requests may be more dangerous than\n\t * PUT collisions because some patch formats need to operate from a\n\t * known base-point or else they will corrupt the resource. Clients\n\t * using this kind of patch application SHOULD use a conditional request\n\t * such that the request will fail if the resource has been updated\n\t * since the client last accessed the resource. For example, the client\n\t * can use a strong ETag [RFC2616] in an If-Match header on the PATCH\n\t * request.\n\t *\n\t * There are also cases where patch formats do not need to operate from\n\t * a known base-point (e.g., appending text lines to log files, or non-\n\t * colliding rows to database tables), in which case the same care in\n\t * client requests is not needed.\n\t *\n\t * The server MUST apply the entire set of changes atomically and never\n\t * provide (e.g., in response to a GET during this operation) a\n\t * partially modified representation. If the entire patch document\n\t * cannot be successfully applied, then the server MUST NOT apply any of\n\t * the changes. The determination of what constitutes a successful\n\t * PATCH can vary depending on the patch document and the type of\n\t * resource(s) being modified. For example, the common 'diff' utility\n\t * can generate a patch document that applies to multiple files in a\n\t * directory hierarchy. The atomicity requirement holds for all\n\t * directly affected files. See \"Error Handling\", Section 2.2, for\n\t * details on status codes and possible error conditions.\n\t *\n\t * If the request passes through a cache and the Request-URI identifies\n\t * one or more currently cached entities, those entries SHOULD be\n\t * treated as stale. A response to this method is only cacheable if it\n\t * contains explicit freshness information (such as an Expires header or\n\t * \"Cache-Control: max-age\" directive) as well as the Content-Location\n\t * header matching the Request-URI, indicating that the PATCH response\n\t * body is a resource representation. A cached PATCH response can only\n\t * be used to respond to subsequent GET and HEAD requests; it MUST NOT\n\t * be used to respond to other methods (in particular, PATCH).\n\t *\n\t * Note that entity-headers contained in the request apply only to the\n\t * contained patch document and MUST NOT be applied to the resource\n\t * being modified. Thus, a Content-Language header could be present on\n\t * the request, but it would only mean (for whatever that's worth) that\n\t * the patch document had a language. Servers SHOULD NOT store such\n\t * headers except as trace information, and SHOULD NOT use such header\n\t * values the same way they might be used on PUT requests. Therefore,\n\t * this document does not specify a way to modify a document's Content-\n\t * Type or Content-Language value through headers, though a mechanism\n\t * could well be designed to achieve this goal through a patch document.\n\t *\n\t * There is no guarantee that a resource can be modified with PATCH.\n\t * Further, it is expected that different patch document formats will be\n\t * appropriate for different types of resources and that no single\n\t * format will be appropriate for all types of resources. Therefore,\n\t * there is no single default patch document format that implementations\n\t * are required to support. Servers MUST ensure that a received patch\n\t * document is appropriate for the type of resource identified by the\n\t * Request-URI.\n\t *\n\t * Clients need to choose when to use PATCH rather than PUT. For\n\t * example, if the patch document size is larger than the size of the\n\t * new resource data that would be used in a PUT, then it might make\n\t * sense to use PUT instead of PATCH. A comparison to POST is even more\n\t * difficult, because POST is used in widely varying ways and can\n\t * encompass PUT and PATCH-like operations if the server chooses. If\n\t * the operation does not modify the resource identified by the Request-\n\t * URI in a predictable way, POST should be considered instead of PATCH\n\t * or PUT.\n\t */\n\tPATCH: 'PATCH'\n} as const;\n\nexport { HttpRequestMethod };"],
5
+ "mappings": "AAGA,IAAMA,EAAoB,CAoCzB,QAAS,UAsBT,IAAK,MAaL,KAAM,OA+BN,KAAM,OAmCN,IAAK,MAeL,OAAQ,SAeR,MAAO,QAKP,QAAS,UA+FT,MAAO,OACR",
6
+ "names": ["HttpRequestMethod"]
7
+ }
@@ -0,0 +1,345 @@
1
+ /** Defining a constant object HTTP response headers */
2
+ declare const HttpResponseHeader: {
3
+ /**
4
+ * Implemented as a misunderstanding of the HTTP specifications. Common because of mistakes in implementations of early HTTP versions. Has exactly the same functionality as standard Connection field.
5
+ *
6
+ * @example
7
+ * proxy-connection: keep-alive
8
+ */
9
+ readonly PROXY_CONNECTION: "proxy-connection";
10
+ /**
11
+ * Server-side deep packet insertion of a unique ID identifying customers of Verizon Wireless, also known as "perma-cookie" or "supercookie"
12
+ *
13
+ * @example
14
+ * x-uidh: ...
15
+ */
16
+ readonly X_UIDH: "x-uidh";
17
+ /**
18
+ * Used to prevent cross-site request forgery. Alternative header names are: X-CSRFToken and X-XSRF-TOKEN
19
+ *
20
+ * @example
21
+ * x-csrf-token: i8XNjC4b8KVok4uw5RftR38Wgp2BFwql
22
+ */
23
+ readonly X_CSRF_TOKEN: "x-csrf-token";
24
+ /**
25
+ * Specifying which web sites can participate in cross-origin resource sharing
26
+ *
27
+ * @example
28
+ * access-control-allow-origin: *
29
+ * Provisional
30
+ */
31
+ readonly ACCESS_CONTROL_ALLOW_ORIGIN: "access-control-allow-origin";
32
+ /**
33
+ * Specifies which patch document formats this server supports
34
+ *
35
+ * @example
36
+ * accept-patch: text/example,charset=utf-8
37
+ * Permanent
38
+ */
39
+ readonly ACCEPT_PATCH: "accept-patch";
40
+ /**
41
+ * What partial content range types this server supports via byte serving
42
+ *
43
+ * @example
44
+ * accept-ranges: bytes
45
+ * Permanent
46
+ */
47
+ readonly ACCEPT_RANGES: "accept-ranges";
48
+ /**
49
+ * The age the object has been in a proxy cache in seconds
50
+ *
51
+ * @example
52
+ * age: 12
53
+ * Permanent
54
+ */
55
+ readonly AGE: "age";
56
+ /**
57
+ * Valid actions for a specified resource. To be used for a 405 Method not allowed
58
+ *
59
+ * @example
60
+ * allow: GET, HEAD
61
+ * Permanent
62
+ */
63
+ readonly ALLOW: "allow";
64
+ /**
65
+ * Tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds
66
+ *
67
+ * @example
68
+ * cache-control: max-age=3600
69
+ * Permanent
70
+ */
71
+ readonly CACHE_CONTROL: "cache-control";
72
+ /**
73
+ * Control options for the current connection and list of hop-by-hop response fields
74
+ *
75
+ * @example
76
+ * connection: close
77
+ * Permanent
78
+ */
79
+ readonly CONNECTION: "connection";
80
+ /**
81
+ * An opportunity to raise a "File Download" dialogue box for a known MIME type with binary format or suggest a filename for dynamic content. Quotes are necessary with special characters.
82
+ *
83
+ * @example
84
+ * content-disposition: attachment, filename="fname.ext"
85
+ * Permanent
86
+ */
87
+ readonly CONTENT_DISPOSITION: "content-disposition";
88
+ /**
89
+ * The type of encoding used on the data. See HTTP compression.
90
+ *
91
+ * @example
92
+ * content-encoding: gzip
93
+ * Permanent
94
+ */
95
+ readonly CONTENT_ENCODING: "content-encoding";
96
+ /**
97
+ * The natural language or languages of the intended audience for the enclosed content
98
+ *
99
+ * @example
100
+ * content-language: da
101
+ * Permanent
102
+ */
103
+ readonly CONTENT_LANGUAGE: "content-language";
104
+ /**
105
+ * The length of the response body in octets (8-bit bytes)
106
+ *
107
+ * @example
108
+ * content-length: 348
109
+ * Permanent
110
+ */
111
+ readonly CONTENT_LENGTH: "content-length";
112
+ /**
113
+ * An alternate location for the returned data
114
+ *
115
+ * @example
116
+ * content-location: /index.htm
117
+ * Permanent
118
+ */
119
+ readonly CONTENT_LOCATION: "content-location";
120
+ /**
121
+ * Where in a full body message this partial message belongs
122
+ *
123
+ * @example
124
+ * content-range: bytes 21010-47021/47022
125
+ * Permanent
126
+ */
127
+ readonly CONTENT_RANGE: "content-range";
128
+ /**
129
+ * The MIME type of this content
130
+ *
131
+ * @example
132
+ * content-type: text/html, charset=utf-8
133
+ * Permanent
134
+ */
135
+ readonly CONTENT_TYPE: "content-type";
136
+ /**
137
+ * The date and time that the message was sent (in "HTTP-date" format as defined by RFC 7231)
138
+ *
139
+ * @example
140
+ * date: Tue, 15 Nov 1994 08:12:31 GMT
141
+ * Permanent
142
+ */
143
+ readonly DATE: "date";
144
+ /**
145
+ * An identifier for a specific version of a resource, often a message digest
146
+ *
147
+ * @example
148
+ * etag: "737060cd8c284d8af7ad3082f209582d"
149
+ * Permanent
150
+ */
151
+ readonly ETAG: "etag";
152
+ /**
153
+ * Gives the date/time after which the response is considered stale (in "HTTP-date" format as defined by RFC 7231)
154
+ *
155
+ * @example
156
+ * expires: Thu, 01 Dec 1994 16:00:00 GMT
157
+ * Permanent
158
+ */
159
+ readonly EXPIRES: "expires";
160
+ /**
161
+ * The last modified date for the requested object (in "HTTP-date" format as defined by RFC 7231)
162
+ *
163
+ * @example
164
+ * last-modified: Tue, 15 Nov 1994 12:45:26 GMT
165
+ * Permanent
166
+ */
167
+ readonly LAST_MODIFIED: "last-modified";
168
+ /**
169
+ * Used to express a typed relationship with another resource, where the relation type is defined by RFC 5988
170
+ *
171
+ * @example
172
+ * link: </feed>, rel="alternate"
173
+ * Permanent
174
+ */
175
+ readonly LINK: "link";
176
+ /**
177
+ * Used in redirection, or when a new resource has been created.
178
+ *
179
+ * @example
180
+ * location: http://www.w3.org/pub/WWW/People.html
181
+ * Permanent
182
+ */
183
+ readonly LOCATION: "location";
184
+ /**
185
+ * This field is supposed to set P3P policy, in the form of P3P:CP="your_compact_policy". However, P3P did not take off, most browsers have never fully
186
+ * implemented it, a lot of websites set this field with fake policy text, that was enough to fool browsers the existence of P3P policy and grant permissions for third party cookies.
187
+ *
188
+ * @example
189
+ * p3p: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
190
+ * Permanent
191
+ */
192
+ readonly P3P: "p3p";
193
+ /**
194
+ * Implementation-specific fields that may have various effects anywhere along the request-response chain.
195
+ *
196
+ * @example
197
+ * pragma: no-cache
198
+ * Permanent
199
+ */
200
+ readonly PRAGMA: "pragma";
201
+ /**
202
+ * Request authentication to access the proxy.
203
+ *
204
+ * @example
205
+ * proxy-authenticate: Basic
206
+ * Permanent
207
+ */
208
+ readonly PROXY_AUTHENTICATION: "proxy-authenticate";
209
+ /**
210
+ * HTTP Public Key Pinning, announces hash of website's authentic TLS certificate
211
+ *
212
+ * @example
213
+ * public-key-pins: max-age=2592000, pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=",
214
+ * Permanent
215
+ */
216
+ readonly PUBLIC_KEY_PINS: "public-key-pins";
217
+ /**
218
+ * If an entity is temporarily unavailable, this instructs the client to try again later. Value could be a specified period of time (in seconds) or a HTTP-date.
219
+ *
220
+ * @example
221
+ * retry-after: 120
222
+ * retry-after: Fri, 07 Nov 2014 23:59:59 GMT
223
+ * Permanent
224
+ */
225
+ readonly RETRY_AFTER: "retry-after";
226
+ /**
227
+ * A name for the server
228
+ *
229
+ * @example
230
+ * server: Apache/2.4.1 (Unix)
231
+ * Permanent
232
+ */
233
+ readonly SERVER: "server";
234
+ /**
235
+ * An HTTP cookie
236
+ *
237
+ * @example
238
+ * set-cookie: UserID=JohnDoe, Max-Age=3600, Version=1
239
+ * Permanent
240
+ */
241
+ readonly SET_COOKIE: "set-cookie";
242
+ /**
243
+ * CGI header field specifying the status of the HTTP response. Normal HTTP responses use a separate "Status-Line" instead, defined by RFC 7230.
244
+ *
245
+ * @example
246
+ * status: 200 OK
247
+ */
248
+ readonly STATUS: "status";
249
+ /**
250
+ * A HSTS Policy informing the HTTP client how long to cache the HTTPS only policy and whether this applies to subdomains.
251
+ *
252
+ * @example
253
+ * strict-transport-security: max-age=16070400, includeSubDomains
254
+ * Permanent
255
+ */
256
+ readonly STRICT_TRANSPORT_SECURITY: "strict-transport-security";
257
+ /**
258
+ * The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfer coding.
259
+ *
260
+ * @example
261
+ * trailer: Max-Forwards
262
+ * Permanent
263
+ */
264
+ readonly TRAILER: "trailer";
265
+ /**
266
+ * The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity.
267
+ *
268
+ * @example
269
+ * transfer-encoding: chunked
270
+ * Permanent
271
+ */
272
+ readonly TRANSFER_ENCODING: "transfer-encoding";
273
+ /**
274
+ * Ask the client to upgrade to another protocol.
275
+ *
276
+ * @example
277
+ * upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
278
+ * Permanent
279
+ */
280
+ readonly UPGRADE: "upgrade";
281
+ /**
282
+ * Tells downstream proxies how to match future request headers to decide whether the cached response can be used rather than requesting a fresh one from the origin server.
283
+ *
284
+ * @example
285
+ * vary: *
286
+ * Permanent
287
+ */
288
+ readonly VARY: "vary";
289
+ /**
290
+ * Informs the client of proxies through which the response was sent.
291
+ *
292
+ * @example
293
+ * via: 1.0 fred, 1.1 example.com (Apache/1.1)
294
+ * Permanent
295
+ */
296
+ readonly VIA: "via";
297
+ /**
298
+ * A general warning about possible problems with the entity body.
299
+ *
300
+ * @example
301
+ * warning: 199 Miscellaneous warning
302
+ * Permanent
303
+ */
304
+ readonly WARNING: "warning";
305
+ /**
306
+ * Indicates the authentication scheme that should be used to access the requested entity.
307
+ *
308
+ * @example
309
+ * www-authenticate: Basic
310
+ * Permanent
311
+ */
312
+ readonly WWW_AUTHENTICATE: "www-authenticate";
313
+ /**
314
+ * Cross-site scripting (XSS) filter
315
+ *
316
+ * @example
317
+ * x-xss-protection: 1, mode=block
318
+ */
319
+ readonly X_XSS_PROTECTION: "x-xss-protection";
320
+ /**
321
+ * The HTTP Content-Security-Policy response header allows web site administrators to control resources the user agent is allowed
322
+ * to load for a given page. With a few exceptions, policies mostly involve specifying server origins and script endpoints.
323
+ * This helps guard against cross-site scripting attacks (Cross-site_scripting).
324
+ *
325
+ * @example
326
+ * content-security-policy: default-src
327
+ */
328
+ readonly CONTENT_SECURITY_POLICY: "content-security-policy";
329
+ /**
330
+ * The only defined value, "nosniff", prevents Internet Explorer from MIME-sniffing a response away from the declared content-type. This also applies to Google Chrome, when downloading extensions.
331
+ *
332
+ * @example
333
+ * x-content-type-options: nosniff
334
+ */
335
+ readonly X_CONTENT_TYPE_OPTIONS: "x-content-type-options";
336
+ /**
337
+ * specifies the technology (e.g. ASP.NET, PHP, JBoss) supporting the web application (version details are often in X-Runtime, X-Version, or X-AspNet-Version)
338
+ *
339
+ * @example
340
+ * x-powered-by: PHP/5.4.0
341
+ */
342
+ readonly X_POWERED_BY: "x-powered-by";
343
+ };
344
+
345
+ export { HttpResponseHeader };