]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/IndustryStandard/Http11.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Http11.h
CommitLineData
4ee9d531 1/** @file\r
9095d37b
LG
2 Hypertext Transfer Protocol -- HTTP/1.1 Standard definitions, from RFC 2616\r
3\r
4 This file contains common HTTP 1.1 definitions from RFC 2616\r
4ee9d531 5\r
015ebfdc 6 (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>\r
9344f092 7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
4ee9d531
SEHM
8**/\r
9\r
10#ifndef __HTTP_11_H__\r
11#define __HTTP_11_H__\r
12\r
13#pragma pack(1)\r
14\r
15///\r
16/// HTTP Version (currently HTTP 1.1)\r
9095d37b 17///\r
4ee9d531
SEHM
18/// The version of an HTTP message is indicated by an HTTP-Version field\r
19/// in the first line of the message.\r
20///\r
21#define HTTP_VERSION "HTTP/1.1"\r
22\r
4ee9d531
SEHM
23///\r
24/// HTTP Request Method definitions\r
9095d37b 25///\r
4ee9d531
SEHM
26/// The Method token indicates the method to be performed on the\r
27/// resource identified by the Request-URI. The method is case-sensitive.\r
28///\r
29#define HTTP_METHOD_OPTIONS "OPTIONS"\r
30#define HTTP_METHOD_GET "GET"\r
31#define HTTP_METHOD_HEAD "HEAD"\r
32#define HTTP_METHOD_POST "POST"\r
33#define HTTP_METHOD_PUT "PUT"\r
34#define HTTP_METHOD_DELETE "DELETE"\r
35#define HTTP_METHOD_TRACE "TRACE"\r
36#define HTTP_METHOD_CONNECT "CONNECT"\r
37#define HTTP_METHOD_PATCH "PATCH"\r
38\r
015ebfdc
SEHM
39///\r
40/// Connect method has maximum length according to EFI_HTTP_METHOD defined in\r
41/// UEFI2.5 spec so use this.\r
42///\r
43#define HTTP_METHOD_MAXIMUM_LEN sizeof (HTTP_METHOD_CONNECT)\r
4ee9d531
SEHM
44\r
45///\r
46/// Accept Request Header\r
9095d37b
LG
47/// The Accept request-header field can be used to specify certain media types which are\r
48/// acceptable for the response. Accept headers can be used to indicate that the request\r
49/// is specifically limited to a small set of desired types, as in the case of a request\r
4ee9d531
SEHM
50/// for an in-line image.\r
51///\r
52#define HTTP_HEADER_ACCEPT "Accept"\r
53\r
54\r
9095d37b 55///\r
4ee9d531 56/// Accept-Charset Request Header\r
9095d37b
LG
57/// The Accept-Charset request-header field can be used to indicate what character sets\r
58/// are acceptable for the response. This field allows clients capable of understanding\r
59/// more comprehensive or special-purpose character sets to signal that capability to a\r
4ee9d531
SEHM
60/// server which is capable of representing documents in those character sets.\r
61///\r
62#define HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset"\r
63\r
9095d37b 64///\r
4ee9d531 65/// Accept-Language Request Header\r
9095d37b
LG
66/// The Accept-Language request-header field is similar to Accept,\r
67/// but restricts the set of natural languages that are preferred\r
4ee9d531
SEHM
68/// as a response to the request.\r
69///\r
70#define HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language"\r
71\r
72///\r
73/// Accept-Ranges Request Header\r
74/// The Accept-Ranges response-header field allows the server to\r
75/// indicate its acceptance of range requests for a resource:\r
76///\r
77#define HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges"\r
78\r
79\r
9095d37b 80///\r
4ee9d531 81/// Accept-Encoding Request Header\r
9095d37b 82/// The Accept-Encoding request-header field is similar to Accept,\r
4ee9d531
SEHM
83/// but restricts the content-codings that are acceptable in the response.\r
84///\r
85#define HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding"\r
86\r
87///\r
88/// Content-Encoding Header\r
9095d37b
LG
89/// The Content-Encoding entity-header field is used as a modifier to the media-type.\r
90/// When present, its value indicates what additional content codings have been applied\r
91/// to the entity-body, and thus what decoding mechanisms must be applied in order to\r
92/// obtain the media-type referenced by the Content-Type header field. Content-Encoding\r
93/// is primarily used to allow a document to be compressed without losing the identity\r
4ee9d531
SEHM
94/// of its underlying media type.\r
95///\r
96#define HTTP_HEADER_CONTENT_ENCODING "Content-Encoding"\r
97\r
9095d37b 98///\r
4ee9d531
SEHM
99/// HTTP Content-Encoding Compression types\r
100///\r
101\r
102#define HTTP_CONTENT_ENCODING_IDENTITY "identity" /// No transformation is used. This is the default value for content coding.\r
103#define HTTP_CONTENT_ENCODING_GZIP "gzip" /// Content-Encoding: GNU zip format (described in RFC 1952).\r
9095d37b
LG
104#define HTTP_CONTENT_ENCODING_COMPRESS "compress" /// encoding format produced by the common UNIX file compression program "compress".\r
105#define HTTP_CONTENT_ENCODING_DEFLATE "deflate" /// The "zlib" format defined in RFC 1950 in combination with the "deflate"\r
015ebfdc 106 /// compression mechanism described in RFC 1951.\r
4ee9d531
SEHM
107\r
108\r
109///\r
110/// Content-Type Header\r
9095d37b
LG
111/// The Content-Type entity-header field indicates the media type of the entity-body sent to\r
112/// the recipient or, in the case of the HEAD method, the media type that would have been sent\r
4ee9d531
SEHM
113/// had the request been a GET.\r
114///\r
115#define HTTP_HEADER_CONTENT_TYPE "Content-Type"\r
116//\r
117// Common Media Types defined in http://www.iana.org/assignments/media-types/media-types.xhtml\r
118//\r
119#define HTTP_CONTENT_TYPE_APP_JSON "application/json"\r
120#define HTTP_CONTENT_TYPE_APP_OCTET_STREAM "application/octet-stream"\r
9095d37b 121\r
4ee9d531
SEHM
122#define HTTP_CONTENT_TYPE_TEXT_HTML "text/html"\r
123#define HTTP_CONTENT_TYPE_TEXT_PLAIN "text/plain"\r
124#define HTTP_CONTENT_TYPE_TEXT_CSS "text/css"\r
125#define HTTP_CONTENT_TYPE_TEXT_XML "text/xml"\r
9095d37b 126\r
4ee9d531
SEHM
127#define HTTP_CONTENT_TYPE_IMAGE_GIF "image/gif"\r
128#define HTTP_CONTENT_TYPE_IMAGE_JPEG "image/jpeg"\r
129#define HTTP_CONTENT_TYPE_IMAGE_PNG "image/png"\r
130#define HTTP_CONTENT_TYPE_IMAGE_SVG_XML "image/svg+xml"\r
131\r
132\r
133///\r
134/// Content-Length Header\r
9095d37b
LG
135/// The Content-Length entity-header field indicates the size of the entity-body,\r
136/// in decimal number of OCTETs, sent to the recipient or, in the case of the HEAD\r
4ee9d531
SEHM
137/// method, the size of the entity-body that would have been sent had the request been a GET.\r
138///\r
139#define HTTP_HEADER_CONTENT_LENGTH "Content-Length"\r
9095d37b 140\r
4ee9d531
SEHM
141///\r
142/// Transfer-Encoding Header\r
9095d37b
LG
143/// The Transfer-Encoding general-header field indicates what (if any) type of transformation\r
144/// has been applied to the message body in order to safely transfer it between the sender\r
145/// and the recipient. This differs from the content-coding in that the transfer-coding\r
4ee9d531
SEHM
146/// is a property of the message, not of the entity.\r
147///\r
148#define HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding"\r
149\r
150\r
015ebfdc
SEHM
151///\r
152/// User Agent Request Header\r
9095d37b
LG
153///\r
154/// The User-Agent request-header field contains information about the user agent originating\r
155/// the request. This is for statistical purposes, the tracing of protocol violations, and\r
156/// automated recognition of user agents for the sake of tailoring responses to avoid\r
157/// particular user agent limitations. User agents SHOULD include this field with requests.\r
158/// The field can contain multiple product tokens and comments identifying the agent and any\r
159/// subproducts which form a significant part of the user agent.\r
160/// By convention, the product tokens are listed in order of their significance for\r
015ebfdc
SEHM
161/// identifying the application.\r
162///\r
163#define HTTP_HEADER_USER_AGENT "User-Agent"\r
164\r
4ee9d531
SEHM
165///\r
166/// Host Request Header\r
167///\r
9095d37b
LG
168/// The Host request-header field specifies the Internet host and port number of the resource\r
169/// being requested, as obtained from the original URI given by the user or referring resource\r
4ee9d531 170///\r
015ebfdc 171#define HTTP_HEADER_HOST "Host"\r
4ee9d531 172\r
015ebfdc
SEHM
173///\r
174/// Location Response Header\r
9095d37b
LG
175///\r
176/// The Location response-header field is used to redirect the recipient to a location other than\r
177/// the Request-URI for completion of the request or identification of a new resource.\r
178/// For 201 (Created) responses, the Location is that of the new resource which was created by\r
179/// the request. For 3xx responses, the location SHOULD indicate the server's preferred URI for\r
015ebfdc
SEHM
180/// automatic redirection to the resource. The field value consists of a single absolute URI.\r
181///\r
182#define HTTP_HEADER_LOCATION "Location"\r
4ee9d531
SEHM
183\r
184///\r
185/// The If-Match request-header field is used with a method to make it conditional.\r
9095d37b
LG
186/// A client that has one or more entities previously obtained from the resource\r
187/// can verify that one of those entities is current by including a list of their\r
188/// associated entity tags in the If-Match header field.\r
189/// The purpose of this feature is to allow efficient updates of cached information\r
190/// with a minimum amount of transaction overhead. It is also used, on updating requests,\r
191/// to prevent inadvertent modification of the wrong version of a resource.\r
4ee9d531
SEHM
192/// As a special case, the value "*" matches any current entity of the resource.\r
193///\r
015ebfdc 194#define HTTP_HEADER_IF_MATCH "If-Match"\r
4ee9d531
SEHM
195\r
196\r
197///\r
9095d37b
LG
198/// The If-None-Match request-header field is used with a method to make it conditional.\r
199/// A client that has one or more entities previously obtained from the resource can verify\r
200/// that none of those entities is current by including a list of their associated entity\r
201/// tags in the If-None-Match header field. The purpose of this feature is to allow efficient\r
202/// updates of cached information with a minimum amount of transaction overhead. It is also used\r
203/// to prevent a method (e.g. PUT) from inadvertently modifying an existing resource when the\r
4ee9d531
SEHM
204/// client believes that the resource does not exist.\r
205///\r
015ebfdc 206#define HTTP_HEADER_IF_NONE_MATCH "If-None-Match"\r
4ee9d531
SEHM
207\r
208\r
209\r
9095d37b 210///\r
4ee9d531
SEHM
211/// Authorization Request Header\r
212/// The Authorization field value consists of credentials\r
213/// containing the authentication information of the user agent for\r
214/// the realm of the resource being requested.\r
215///\r
015ebfdc 216#define HTTP_HEADER_AUTHORIZATION "Authorization"\r
4ee9d531
SEHM
217\r
218///\r
219/// ETAG Response Header\r
9095d37b
LG
220/// The ETag response-header field provides the current value of the entity tag\r
221/// for the requested variant.\r
4ee9d531 222///\r
015ebfdc 223#define HTTP_HEADER_ETAG "ETag"\r
4ee9d531 224\r
015ebfdc
SEHM
225///\r
226/// Custom header field checked by the iLO web server to\r
227/// specify a client session key.\r
228/// Example: X-Auth-Token: 24de6b1f8fa147ad59f6452def628798\r
229///\r
230#define HTTP_HEADER_X_AUTH_TOKEN "X-Auth-Token"\r
4ee9d531 231\r
2c1c50fc
NH
232///\r
233/// Expect Header\r
234/// The "Expect" header field in a request indicates a certain set of\r
235/// behaviors (expectations) that need to be supported by the server in\r
236/// order to properly handle this request. The only such expectation\r
237/// defined by this specification is 100-continue.\r
238///\r
239#define HTTP_HEADER_EXPECT "Expect"\r
240\r
241///\r
242/// Expect Header Value\r
243///\r
244#define HTTP_EXPECT_100_CONTINUE "100-continue"\r
245\r
4ee9d531 246#pragma pack()\r
015ebfdc 247\r
4ee9d531 248#endif\r