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