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