]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add HTTP 1.1 industry standard definitions.
authorSamer El-Haj-Mahmoud <elhaj@hpe.com>
Tue, 22 Dec 2015 01:42:26 +0000 (01:42 +0000)
committersfu5 <sfu5@Edk2>
Tue, 22 Dec 2015 01:42:26 +0000 (01:42 +0000)
Add common HTTP 1.1 industry standard definitions for use in HTTP
clients/applications. List includes: HTTP methods, request/response
headers, and encodings.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19435 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/IndustryStandard/Http11.h [new file with mode: 0644]

diff --git a/MdePkg/Include/IndustryStandard/Http11.h b/MdePkg/Include/IndustryStandard/Http11.h
new file mode 100644 (file)
index 0000000..6c22f94
--- /dev/null
@@ -0,0 +1,208 @@
+/** @file\r
+  Hypertext Transfer Protocol -- HTTP/1.1 Standard definitions, from RFC 2616    \r
+\r
+  This file contains common HTTP 1.1 definitions from RFC 2616 \r
+   \r
+  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
+#ifndef __HTTP_11_H__\r
+#define __HTTP_11_H__\r
+\r
+#pragma pack(1)\r
+\r
+///\r
+/// HTTP Version (currently HTTP 1.1)\r
+/// \r
+/// The version of an HTTP message is indicated by an HTTP-Version field\r
+/// in the first line of the message.\r
+///\r
+#define HTTP_VERSION        "HTTP/1.1"\r
+\r
+\r
+///\r
+/// HTTP Request Method definitions\r
+/// \r
+/// The Method  token indicates the method to be performed on the\r
+/// resource identified by the Request-URI. The method is case-sensitive.\r
+///\r
+#define HTTP_METHOD_OPTIONS "OPTIONS"\r
+#define HTTP_METHOD_GET     "GET"\r
+#define HTTP_METHOD_HEAD    "HEAD"\r
+#define HTTP_METHOD_POST    "POST"\r
+#define HTTP_METHOD_PUT     "PUT"\r
+#define HTTP_METHOD_DELETE  "DELETE"\r
+#define HTTP_METHOD_TRACE   "TRACE"\r
+#define HTTP_METHOD_CONNECT "CONNECT"\r
+#define HTTP_METHOD_PATCH   "PATCH"\r
+\r
+#define HTTP_METHOD_MAXIMUM_LEN  sizeof ("CONNECT")\r
+\r
+///\r
+/// Accept Request Header\r
+/// The Accept request-header field can be used to specify certain media types which are \r
+/// acceptable for the response. Accept headers can be used to indicate that the request \r
+/// is specifically limited to a small set of desired types, as in the case of a request \r
+/// for an in-line image.\r
+///\r
+#define HTTP_HEADER_ACCEPT             "Accept"\r
+\r
+\r
+/// \r
+/// Accept-Charset Request Header\r
+/// The Accept-Charset request-header field can be used to indicate what character sets \r
+/// are acceptable for the response. This field allows clients capable of understanding \r
+/// more comprehensive or special-purpose character sets to signal that capability to a \r
+/// server which is capable of representing documents in those character sets.\r
+///\r
+#define HTTP_HEADER_ACCEPT_CHARSET     "Accept-Charset"\r
+\r
+/// \r
+/// Accept-Language Request Header\r
+/// The Accept-Language request-header field is similar to Accept, \r
+/// but restricts the set of natural languages that are preferred \r
+/// as a response to the request.\r
+///\r
+#define HTTP_HEADER_ACCEPT_LANGUAGE    "Accept-Language"\r
+\r
+///\r
+/// Accept-Ranges Request Header\r
+/// The Accept-Ranges response-header field allows the server to\r
+/// indicate its acceptance of range requests for a resource:\r
+///\r
+#define HTTP_HEADER_ACCEPT_RANGES      "Accept-Ranges"\r
+\r
+\r
+/// \r
+/// Accept-Encoding Request Header\r
+/// The Accept-Encoding request-header field is similar to Accept, \r
+/// but restricts the content-codings that are acceptable in the response.\r
+///\r
+#define HTTP_HEADER_ACCEPT_ENCODING    "Accept-Encoding"\r
+\r
+///\r
+/// Content-Encoding Header\r
+/// The Content-Encoding entity-header field is used as a modifier to the media-type. \r
+/// When present, its value indicates what additional content codings have been applied \r
+/// to the entity-body, and thus what decoding mechanisms must be applied in order to \r
+/// obtain the media-type referenced by the Content-Type header field. Content-Encoding \r
+/// is primarily used to allow a document to be compressed without losing the identity \r
+/// of its underlying media type.\r
+///\r
+#define HTTP_HEADER_CONTENT_ENCODING   "Content-Encoding"\r
+\r
+/// \r
+/// HTTP Content-Encoding Compression types\r
+///\r
+\r
+#define HTTP_CONTENT_ENCODING_IDENTITY "identity"  /// No transformation is used. This is the default value for content coding.\r
+#define HTTP_CONTENT_ENCODING_GZIP     "gzip"      /// Content-Encoding: GNU zip format (described in RFC 1952).\r
+#define HTTP_CONTENT_ENCODING_COMPRESS "compress"  /// encoding format produced by the common UNIX file compression program "compress". \r
+#define HTTP_CONTENT_ENCODING_DEFLATE  "deflate"   /// The "zlib" format defined in RFC 1950 in combination with the "deflate" \r
+                                                    /// compression mechanism described in RFC 1951.\r
+\r
+\r
+///\r
+/// Content-Type Header\r
+/// The Content-Type entity-header field indicates the media type of the entity-body sent to \r
+/// the recipient or, in the case of the HEAD method, the media type that would have been sent \r
+/// had the request been a GET.\r
+///\r
+#define HTTP_HEADER_CONTENT_TYPE       "Content-Type"\r
+//\r
+// Common Media Types defined in http://www.iana.org/assignments/media-types/media-types.xhtml\r
+//\r
+#define HTTP_CONTENT_TYPE_APP_JSON          "application/json"\r
+#define HTTP_CONTENT_TYPE_APP_OCTET_STREAM  "application/octet-stream"\r
+                                           \r
+#define HTTP_CONTENT_TYPE_TEXT_HTML         "text/html"\r
+#define HTTP_CONTENT_TYPE_TEXT_PLAIN        "text/plain"\r
+#define HTTP_CONTENT_TYPE_TEXT_CSS          "text/css"\r
+#define HTTP_CONTENT_TYPE_TEXT_XML          "text/xml"\r
+                                           \r
+#define HTTP_CONTENT_TYPE_IMAGE_GIF         "image/gif"\r
+#define HTTP_CONTENT_TYPE_IMAGE_JPEG        "image/jpeg"\r
+#define HTTP_CONTENT_TYPE_IMAGE_PNG         "image/png"\r
+#define HTTP_CONTENT_TYPE_IMAGE_SVG_XML     "image/svg+xml"\r
+\r
+\r
+///\r
+/// Content-Length Header\r
+/// The Content-Length entity-header field indicates the size of the entity-body, \r
+/// in decimal number of OCTETs, sent to the recipient or, in the case of the HEAD \r
+/// method, the size of the entity-body that would have been sent had the request been a GET.\r
+///\r
+#define HTTP_HEADER_CONTENT_LENGTH     "Content-Length"\r
+                                                                                                              \r
+///\r
+/// Transfer-Encoding Header\r
+/// The Transfer-Encoding general-header field indicates what (if any) type of transformation \r
+/// has been applied to the message body in order to safely transfer it between the sender \r
+/// and the recipient. This differs from the content-coding in that the transfer-coding \r
+/// is a property of the message, not of the entity.\r
+///\r
+#define HTTP_HEADER_TRANSFER_ENCODING  "Transfer-Encoding"\r
+\r
+\r
+///\r
+/// Host Request Header\r
+///\r
+/// The Host request-header field specifies the Internet host and port number of the resource \r
+/// being requested, as obtained from the original URI given by the user or referring resource \r
+///\r
+#define  HTTP_HEADER_HOST              "Host"\r
+\r
+\r
+///\r
+/// The If-Match request-header field is used with a method to make it conditional.\r
+/// A client that has one or more entities previously obtained from the resource \r
+/// can verify that one of those entities is current by including a list of their \r
+/// associated entity tags in the If-Match header field. \r
+/// The purpose of this feature is to allow efficient updates of cached information \r
+/// with a minimum amount of transaction overhead. It is also used, on updating requests, \r
+/// to prevent inadvertent modification of the wrong version of a resource. \r
+/// As a special case, the value "*" matches any current entity of the resource.\r
+///\r
+#define  HTTP_HEADER_IF_MATCH          "If-Match"\r
+\r
+\r
+///\r
+/// The If-None-Match request-header field is used with a method to make it conditional. \r
+/// A client that has one or more entities previously obtained from the resource can verify \r
+/// that none of those entities is current by including a list of their associated entity \r
+/// tags in the If-None-Match header field. The purpose of this feature is to allow efficient \r
+/// updates of cached information with a minimum amount of transaction overhead. It is also used \r
+/// to prevent a method (e.g. PUT) from inadvertently modifying an existing resource when the \r
+/// client believes that the resource does not exist.\r
+///\r
+#define  HTTP_HEADER_IF_NONE_MATCH     "If-None-Match"\r
+\r
+\r
+\r
+/// \r
+/// Authorization Request Header\r
+/// The Authorization field value consists of credentials\r
+/// containing the authentication information of the user agent for\r
+/// the realm of the resource being requested.\r
+///\r
+#define  HTTP_HEADER_AUTHORIZATION     "Authorization"\r
+\r
+///\r
+/// ETAG Response Header\r
+/// The ETag response-header field provides the current value of the entity tag \r
+/// for the requested variant. \r
+///\r
+#define  HTTP_HEADER_ETAG              "ETag"\r
+\r
+\r
+\r
+\r
+#pragma pack()\r
+#endif\r