]>
Commit | Line | Data |
---|---|---|
4ee9d531 SEHM |
1 | /** @file\r |
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 | |
5 | \r | |
6 | (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r | |
7 | This program and the accompanying materials\r | |
8 | are licensed and made available under the terms and conditions of the BSD License\r | |
9 | which accompanies this distribution. The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php\r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __HTTP_11_H__\r | |
17 | #define __HTTP_11_H__\r | |
18 | \r | |
19 | #pragma pack(1)\r | |
20 | \r | |
21 | ///\r | |
22 | /// HTTP Version (currently HTTP 1.1)\r | |
23 | /// \r | |
24 | /// The version of an HTTP message is indicated by an HTTP-Version field\r | |
25 | /// in the first line of the message.\r | |
26 | ///\r | |
27 | #define HTTP_VERSION "HTTP/1.1"\r | |
28 | \r | |
29 | \r | |
30 | ///\r | |
31 | /// HTTP Request Method definitions\r | |
32 | /// \r | |
33 | /// The Method token indicates the method to be performed on the\r | |
34 | /// resource identified by the Request-URI. The method is case-sensitive.\r | |
35 | ///\r | |
36 | #define HTTP_METHOD_OPTIONS "OPTIONS"\r | |
37 | #define HTTP_METHOD_GET "GET"\r | |
38 | #define HTTP_METHOD_HEAD "HEAD"\r | |
39 | #define HTTP_METHOD_POST "POST"\r | |
40 | #define HTTP_METHOD_PUT "PUT"\r | |
41 | #define HTTP_METHOD_DELETE "DELETE"\r | |
42 | #define HTTP_METHOD_TRACE "TRACE"\r | |
43 | #define HTTP_METHOD_CONNECT "CONNECT"\r | |
44 | #define HTTP_METHOD_PATCH "PATCH"\r | |
45 | \r | |
46 | #define HTTP_METHOD_MAXIMUM_LEN sizeof ("CONNECT")\r | |
47 | \r | |
48 | ///\r | |
49 | /// Accept Request Header\r | |
50 | /// The Accept request-header field can be used to specify certain media types which are \r | |
51 | /// acceptable for the response. Accept headers can be used to indicate that the request \r | |
52 | /// is specifically limited to a small set of desired types, as in the case of a request \r | |
53 | /// for an in-line image.\r | |
54 | ///\r | |
55 | #define HTTP_HEADER_ACCEPT "Accept"\r | |
56 | \r | |
57 | \r | |
58 | /// \r | |
59 | /// Accept-Charset Request Header\r | |
60 | /// The Accept-Charset request-header field can be used to indicate what character sets \r | |
61 | /// are acceptable for the response. This field allows clients capable of understanding \r | |
62 | /// more comprehensive or special-purpose character sets to signal that capability to a \r | |
63 | /// server which is capable of representing documents in those character sets.\r | |
64 | ///\r | |
65 | #define HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset"\r | |
66 | \r | |
67 | /// \r | |
68 | /// Accept-Language Request Header\r | |
69 | /// The Accept-Language request-header field is similar to Accept, \r | |
70 | /// but restricts the set of natural languages that are preferred \r | |
71 | /// as a response to the request.\r | |
72 | ///\r | |
73 | #define HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language"\r | |
74 | \r | |
75 | ///\r | |
76 | /// Accept-Ranges Request Header\r | |
77 | /// The Accept-Ranges response-header field allows the server to\r | |
78 | /// indicate its acceptance of range requests for a resource:\r | |
79 | ///\r | |
80 | #define HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges"\r | |
81 | \r | |
82 | \r | |
83 | /// \r | |
84 | /// Accept-Encoding Request Header\r | |
85 | /// The Accept-Encoding request-header field is similar to Accept, \r | |
86 | /// but restricts the content-codings that are acceptable in the response.\r | |
87 | ///\r | |
88 | #define HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding"\r | |
89 | \r | |
90 | ///\r | |
91 | /// Content-Encoding Header\r | |
92 | /// The Content-Encoding entity-header field is used as a modifier to the media-type. \r | |
93 | /// When present, its value indicates what additional content codings have been applied \r | |
94 | /// to the entity-body, and thus what decoding mechanisms must be applied in order to \r | |
95 | /// obtain the media-type referenced by the Content-Type header field. Content-Encoding \r | |
96 | /// is primarily used to allow a document to be compressed without losing the identity \r | |
97 | /// of its underlying media type.\r | |
98 | ///\r | |
99 | #define HTTP_HEADER_CONTENT_ENCODING "Content-Encoding"\r | |
100 | \r | |
101 | /// \r | |
102 | /// HTTP Content-Encoding Compression types\r | |
103 | ///\r | |
104 | \r | |
105 | #define HTTP_CONTENT_ENCODING_IDENTITY "identity" /// No transformation is used. This is the default value for content coding.\r | |
106 | #define HTTP_CONTENT_ENCODING_GZIP "gzip" /// Content-Encoding: GNU zip format (described in RFC 1952).\r | |
107 | #define HTTP_CONTENT_ENCODING_COMPRESS "compress" /// encoding format produced by the common UNIX file compression program "compress". \r | |
108 | #define HTTP_CONTENT_ENCODING_DEFLATE "deflate" /// The "zlib" format defined in RFC 1950 in combination with the "deflate" \r | |
109 | /// compression mechanism described in RFC 1951.\r | |
110 | \r | |
111 | \r | |
112 | ///\r | |
113 | /// Content-Type Header\r | |
114 | /// The Content-Type entity-header field indicates the media type of the entity-body sent to \r | |
115 | /// the recipient or, in the case of the HEAD method, the media type that would have been sent \r | |
116 | /// had the request been a GET.\r | |
117 | ///\r | |
118 | #define HTTP_HEADER_CONTENT_TYPE "Content-Type"\r | |
119 | //\r | |
120 | // Common Media Types defined in http://www.iana.org/assignments/media-types/media-types.xhtml\r | |
121 | //\r | |
122 | #define HTTP_CONTENT_TYPE_APP_JSON "application/json"\r | |
123 | #define HTTP_CONTENT_TYPE_APP_OCTET_STREAM "application/octet-stream"\r | |
124 | \r | |
125 | #define HTTP_CONTENT_TYPE_TEXT_HTML "text/html"\r | |
126 | #define HTTP_CONTENT_TYPE_TEXT_PLAIN "text/plain"\r | |
127 | #define HTTP_CONTENT_TYPE_TEXT_CSS "text/css"\r | |
128 | #define HTTP_CONTENT_TYPE_TEXT_XML "text/xml"\r | |
129 | \r | |
130 | #define HTTP_CONTENT_TYPE_IMAGE_GIF "image/gif"\r | |
131 | #define HTTP_CONTENT_TYPE_IMAGE_JPEG "image/jpeg"\r | |
132 | #define HTTP_CONTENT_TYPE_IMAGE_PNG "image/png"\r | |
133 | #define HTTP_CONTENT_TYPE_IMAGE_SVG_XML "image/svg+xml"\r | |
134 | \r | |
135 | \r | |
136 | ///\r | |
137 | /// Content-Length Header\r | |
138 | /// The Content-Length entity-header field indicates the size of the entity-body, \r | |
139 | /// in decimal number of OCTETs, sent to the recipient or, in the case of the HEAD \r | |
140 | /// method, the size of the entity-body that would have been sent had the request been a GET.\r | |
141 | ///\r | |
142 | #define HTTP_HEADER_CONTENT_LENGTH "Content-Length"\r | |
143 | \r | |
144 | ///\r | |
145 | /// Transfer-Encoding Header\r | |
146 | /// The Transfer-Encoding general-header field indicates what (if any) type of transformation \r | |
147 | /// has been applied to the message body in order to safely transfer it between the sender \r | |
148 | /// and the recipient. This differs from the content-coding in that the transfer-coding \r | |
149 | /// is a property of the message, not of the entity.\r | |
150 | ///\r | |
151 | #define HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding"\r | |
152 | \r | |
153 | \r | |
154 | ///\r | |
155 | /// Host Request Header\r | |
156 | ///\r | |
157 | /// The Host request-header field specifies the Internet host and port number of the resource \r | |
158 | /// being requested, as obtained from the original URI given by the user or referring resource \r | |
159 | ///\r | |
160 | #define HTTP_HEADER_HOST "Host"\r | |
161 | \r | |
162 | \r | |
163 | ///\r | |
164 | /// The If-Match request-header field is used with a method to make it conditional.\r | |
165 | /// A client that has one or more entities previously obtained from the resource \r | |
166 | /// can verify that one of those entities is current by including a list of their \r | |
167 | /// associated entity tags in the If-Match header field. \r | |
168 | /// The purpose of this feature is to allow efficient updates of cached information \r | |
169 | /// with a minimum amount of transaction overhead. It is also used, on updating requests, \r | |
170 | /// to prevent inadvertent modification of the wrong version of a resource. \r | |
171 | /// As a special case, the value "*" matches any current entity of the resource.\r | |
172 | ///\r | |
173 | #define HTTP_HEADER_IF_MATCH "If-Match"\r | |
174 | \r | |
175 | \r | |
176 | ///\r | |
177 | /// The If-None-Match request-header field is used with a method to make it conditional. \r | |
178 | /// A client that has one or more entities previously obtained from the resource can verify \r | |
179 | /// that none of those entities is current by including a list of their associated entity \r | |
180 | /// tags in the If-None-Match header field. The purpose of this feature is to allow efficient \r | |
181 | /// updates of cached information with a minimum amount of transaction overhead. It is also used \r | |
182 | /// to prevent a method (e.g. PUT) from inadvertently modifying an existing resource when the \r | |
183 | /// client believes that the resource does not exist.\r | |
184 | ///\r | |
185 | #define HTTP_HEADER_IF_NONE_MATCH "If-None-Match"\r | |
186 | \r | |
187 | \r | |
188 | \r | |
189 | /// \r | |
190 | /// Authorization Request Header\r | |
191 | /// The Authorization field value consists of credentials\r | |
192 | /// containing the authentication information of the user agent for\r | |
193 | /// the realm of the resource being requested.\r | |
194 | ///\r | |
195 | #define HTTP_HEADER_AUTHORIZATION "Authorization"\r | |
196 | \r | |
197 | ///\r | |
198 | /// ETAG Response Header\r | |
199 | /// The ETag response-header field provides the current value of the entity tag \r | |
200 | /// for the requested variant. \r | |
201 | ///\r | |
202 | #define HTTP_HEADER_ETAG "ETag"\r | |
203 | \r | |
204 | \r | |
205 | \r | |
206 | \r | |
207 | #pragma pack()\r | |
208 | #endif\r |