2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FNetHttpHttpTypes.h
20 * @brief This is the header file for defining the primitive types for the HTTP operations.
22 * This header file contains the definition of the primitive types for the HTTP operations.
25 #ifndef _FNET_HTTP_HTTP_TYPES_H_
26 #define _FNET_HTTP_HTTP_TYPES_H_
28 #include "FBaseObject.h"
29 #include "FBaseColIComparer.h"
30 #include "FBaseString.h"
31 #include "FBaseErrorDefine.h"
32 #include "FBaseColIHashCodeProvider.h"
34 namespace Tizen { namespace Net { namespace Http
40 * Defines the HTTP method types. For the detailed description of each method, refer to HttpRequest::SetMethod().
46 NET_HTTP_METHOD_GET = 0x40, /**< The HTTP GET Method */
47 NET_HTTP_METHOD_OPTIONS = 0x41, /**< The HTTP OPTIONS Method */
48 NET_HTTP_METHOD_HEAD = 0x42, /**< The HTTP HEAD Method */
49 NET_HTTP_METHOD_DELETE = 0x43, /**< The HTTP DELETE Method */
50 NET_HTTP_METHOD_TRACE = 0x44, /**< The HTTP TRACE Method */
51 NET_HTTP_METHOD_POST = 0x60, /**< The HTTP POST Method */
52 NET_HTTP_METHOD_PUT = 0x61, /**< The HTTP PUT Method */
53 NET_HTTP_METHOD_CONNECT = 0x70, /**< The HTTP CONNECT Method */
57 * @enum NetHttpSessionMode
59 * Defines the HTTP session mode.
63 enum NetHttpSessionMode
65 NET_HTTP_SESSION_MODE_NORMAL, /**< The Normal Mode */
66 NET_HTTP_SESSION_MODE_PIPELINING, /**< The Pipelining mode */
67 NET_HTTP_SESSION_MODE_MULTIPLE_HOST /**< The Multiple host mode */
73 * Defines the HTTP version
79 HTTP_VERSION_1_0, /**< %Http version 1.0 */
80 HTTP_VERSION_1_1 /**< %Http version 1.1 */
85 * @enum NetHttpStatusCode
87 * Defines the HTTP status code.
89 * @brief <i> [Deprecated] </i>
90 * @deprecated This enum is deprecated. Instead of using this enum, it is recommended to use the HTTP_STATUS_XXX constants.
94 enum NetHttpStatusCode
96 NET_HTTP_STATUS_UNDEFINED = 0, /**< @if OSPDEPREC The undefined status @endif */
97 NET_HTTP_STATUS_CONTINUE = 100, /**< @if OSPDEPREC The status code: 100 Continue @endif */
98 NET_HTTP_STATUS_SWITCHING_PROTOCOLS = 101, /**< @if OSPDEPREC The status code: 101 Switching Protocols @endif */
99 NET_HTTP_STATUS_OK = 200, /**< @if OSPDEPREC The status code: 200 OK @endif */
100 NET_HTTP_STATUS_CREATED = 201, /**< @if OSPDEPREC The status code: 201 Created @endif */
101 NET_HTTP_STATUS_ACCEPTED = 202, /**< @if OSPDEPREC The status code: 202 Accepted @endif */
102 NET_HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION = 203, /**< @if OSPDEPREC The status code: 203 Non-Authoritative Information @endif */
103 NET_HTTP_STATUS_NO_CONTENT = 204, /**< @if OSPDEPREC The status code: 204 No %Content @endif */
104 NET_HTTP_STATUS_RESET_CONTENT = 205, /**< @if OSPDEPREC The status code: 205 Reset %Content @endif */
105 NET_HTTP_STATUS_PARTIAL_CONTENT = 206, /**< @if OSPDEPREC The status code: 206 Partial %Content @endif */
107 NET_HTTP_STATUS_MULTIPLE_CHOICE = 300, /**< @if OSPDEPREC The status code: 300 Multiple Choices @endif */
108 NET_HTTP_STATUS_MOVED_PERMANENTLY = 301, /**< @if OSPDEPREC The status code: 301 Moved Permanently @endif */
109 NET_HTTP_STATUS_MOVED_TEMPORARILY = 302, /**< @if OSPDEPREC The status code: 302 Found @endif */
110 NET_HTTP_STATUS_SEE_OTHER = 303, /**< @if OSPDEPREC The status code: 303 See Other @endif */
111 NET_HTTP_STATUS_NOT_MODIFIED = 304, /**< @if OSPDEPREC The status code: 304 Not Modified @endif */
112 NET_HTTP_STATUS_USE_PROXY = 305, /**< @if OSPDEPREC The status code: 305 Use Proxy @endif */
114 NET_HTTP_STATUS_BAD_REQUEST = 400, /**< @if OSPDEPREC The status code: 400 Bad Request @endif */
115 NET_HTTP_STATUS_UNAUTHORIZED = 401, /**< @if OSPDEPREC The status code: 401 Unauthorized @endif */
116 NET_HTTP_STATUS_PAYMENT_REQUIRED = 402, /**< @if OSPDEPREC The status code: 402 Payment Required @endif */
117 NET_HTTP_STATUS_FORBIDDEN = 403, /**< @if OSPDEPREC The status code: 403 Forbidden @endif */
118 NET_HTTP_STATUS_NOT_FOUND = 404, /**<@if OSPDEPREC The status code: 404 Not Found @endif */
119 NET_HTTP_STATUS_METHOD_NOT_ALLOWED = 405, /**< @if OSPDEPREC The status code: 405 Method Not Allowed @endif */
120 NET_HTTP_STATUS_NOT_ACCEPTABLE = 406, /**< @if OSPDEPREC The status code: 406 Not Acceptable @endif */
121 NET_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED = 407, /**< @if OSPDEPREC The status code: 407 Proxy Authentication Required @endif */
122 NET_HTTP_STATUS_REQUEST_TIME_OUT = 408, /**< @if OSPDEPREC The status code: 408 Request Timeout (not used) @endif */
123 NET_HTTP_STATUS_CONFLICT = 409, /**<@if OSPDEPREC The status code: 409 Conflict @endif */
124 NET_HTTP_STATUS_GONE = 410, /**< @if OSPDEPREC The status code: 410 Gone @endif */
125 NET_HTTP_STATUS_LENGTH_REQUIRED = 411, /**< @if OSPDEPREC The status code: 411 Length Required @endif */
126 NET_HTTP_STATUS_PRECONDITION_FAILED = 412, /**<@if OSPDEPREC The status code: 412 Precondition Failed @endif */
127 NET_HTTP_STATUS_REQUEST_ENTITY_TOO_LARGE = 413, /**< @if OSPDEPREC The status code: 413 Request Entity Too Large (not used) @endif */
128 NET_HTTP_STATUS_REQUEST_URI_TOO_LARGE = 414, /**< @if OSPDEPREC The status code: 414 Request-URI Too Long (not used) @endif */
129 NET_HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415, /**< @if OSPDEPREC The status code: 415 Unsupported %Media Type @endif */
131 NET_HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, /**< @if OSPDEPREC The status code: 500 Internal Server Error @endif */
132 NET_HTTP_STATUS_NOT_IMPLEMENTED = 501, /**< @if OSPDEPREC The status code: 501 Not Implemented @endif */
133 NET_HTTP_STATUS_BAD_GATEWAY = 502, /**< @if OSPDEPREC The status code: 502 Bad Gateway @endif */
134 NET_HTTP_STATUS_SERVICE_UNAVAILABLE = 503, /**< @if OSPDEPREC The status code: 503 Service Unavailable @endif */
135 NET_HTTP_STATUS_GATEWAY_TIME_OUT = 504, /**< @if OSPDEPREC The status code: 504 Gateway Timeout @endif */
136 NET_HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED = 505 /**< @if OSPDEPREC The status code: 505 HTTP Version Not Supported @endif */
140 * Status Code: 100 Continue
144 static const int HTTP_STATUS_CONTINUE = 100;
146 * Status Code: 101 Switching Protocols
150 static const int HTTP_STATUS_SWITCHING_PROTOCOLS = 101;
153 * Status Code: 200 OK
157 static const int HTTP_STATUS_OK = 200;
159 * Status Code: 201 Created
163 static const int HTTP_STATUS_CREATED = 201;
165 * Status Code: 202 Accepted
169 static const int HTTP_STATUS_ACCEPTED = 202;
171 * Status Code: 203 Non-Authoritative Information
175 static const int HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION = 203;
177 * Status Code: 204 No %Content
181 static const int HTTP_STATUS_NO_CONTENT = 204;
183 * Status Code: 205 Reset %Content
187 static const int HTTP_STATUS_RESET_CONTENT = 205;
189 * Status Code: 206 Partial %Content
193 static const int HTTP_STATUS_PARTIAL_CONTENT = 206;
195 * Status Code: 300 Multiple Choices
199 static const int HTTP_STATUS_MULTIPLE_CHOICE = 300;
201 * Status Code: 301 Moved Permanently
205 static const int HTTP_STATUS_MOVED_PERMANENTLY = 301;
207 * Status Code: 302 Found
211 static const int HTTP_STATUS_FOUND = 302;
213 * Status Code: 303 See Other
217 static const int HTTP_STATUS_SEE_OTHER = 303;
219 * Status Code: 304 Not Modified
223 static const int HTTP_STATUS_NOT_MODIFIED = 304;
225 * Status Code: 305 Use Proxy
229 static const int HTTP_STATUS_USE_PROXY = 305;
231 * Status Code: 306 Switch Proxy
235 static const int HTTP_STATUS_SWITCH_PROXY = 306;
237 * Status Code: 307 Temporary Redirect
241 static const int HTTP_STATUS_TEMPORARY_REDIRECT = 307;
244 * Status Code: 400 Bad Request
248 static const int HTTP_STATUS_BAD_REQUEST = 400;
250 * Status Code: 401 Unauthorized
254 static const int HTTP_STATUS_UNAUTHORIZED = 401;
256 * Status Code: 402 Payment Required
260 static const int HTTP_STATUS_PAYMENT_REQUIRED = 402;
262 * Status Code: 403 Forbidden
266 static const int HTTP_STATUS_FORBIDDEN = 403;
268 * Status Code: 404 Not Found
272 static const int HTTP_STATUS_NOT_FOUND = 404;
274 * Status Code: 405 Method Not Allowed
278 static const int HTTP_STATUS_METHOD_NOT_ALLOWED = 405;
280 * Status Code: 406 Not Acceptable
284 static const int HTTP_STATUS_NOT_ACCEPTABLE = 406;
286 * Status Code: 407 Proxy Authentication Required
290 static const int HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED = 407;
292 * Status Code: 408 Request Timeout
296 static const int HTTP_STATUS_REQUEST_TIMEOUT = 408;
298 * Status Code: 409 Conflict
302 static const int HTTP_STATUS_CONFLICT = 409;
304 * Status Code: 410 Gone
308 static const int HTTP_STATUS_GONE = 410;
310 * Status Code: 411 Length Required
314 static const int HTTP_STATUS_LENGTH_REQUIRED = 411;
316 * Status Code: 412 Precondition Failed
320 static const int HTTP_STATUS_PRECONDITION_FAILED = 412;
322 * Status Code: 413 Request Entity Too Large
326 static const int HTTP_STATUS_REQUEST_ENTITY_TOO_LARGE = 413;
328 * Status Code: 414 Request-URI Too Long
332 static const int HTTP_STATUS_REQUEST_URI_TOO_LONG = 414;
334 * Status Code: 415 Unsupported %Media Type
338 static const int HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415;
340 * Status Code: 416 Requested Range Not Satisfiable
344 static const int HTTP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
346 * Status Code: 417 Expectation Failed
350 static const int HTTP_STATUS_EXPECTATION_FAILED = 417;
354 * Status Code: 500 Internal Server Error
358 static const int HTTP_STATUS_INTERNAL_SERVER_ERROR = 500;
360 * Status Code: 501 Not Implemented
364 static const int HTTP_STATUS_NOT_IMPLEMENTED = 501;
366 * Status Code: 502 Bad Gateway
370 static const int HTTP_STATUS_BAD_GATEWAY = 502;
372 * Status Code: 503 Service Unavailable
376 static const int HTTP_STATUS_SERVICE_UNAVAILABLE = 503;
378 * Status Code: 504 Gateway Timeout
382 static const int HTTP_STATUS_GATEWAY_TIMEOUT = 504;
384 * Status Code: 505 HTTP Version Not Supported
388 static const int HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED = 505;
391 * @enum NetHttpAuthScheme
393 * Defines the supported authentication schemes.
397 enum NetHttpAuthScheme
399 NET_HTTP_AUTH_NONE = 0, /**< The no authentication type */
400 NET_HTTP_AUTH_PROXY_BASIC = 1, /**< The authentication type is Proxy Basic Authentication */
401 NET_HTTP_AUTH_PROXY_MD5 = 2, /**< The authentication type is Proxy Digest Authentication */
402 NET_HTTP_AUTH_WWW_BASIC = 3, /**< The authentication Type is HTTP Basic Authentication */
403 NET_HTTP_AUTH_WWW_MD5 = 4, /**< The authentication type is HTTP Digest Authentication */
404 NET_HTTP_AUTH_PROXY_NTLM = 5, /**< The authentication type is Proxy NTLM Authentication */
405 NET_HTTP_AUTH_WWW_NTLM = 7, /**< The authentication type is NTLM Authentication */
406 NET_HTTP_AUTH_WWW_NEGOTIATE = 8 /**< The authentication type is Negotiate Authentication */
410 * @enum NetHttpCookieFlag
412 * Defines the HTTP cookie mode.
416 enum NetHttpCookieFlag
418 NET_HTTP_COOKIE_FLAG_NONE, /**< The mode is not defined */
419 NET_HTTP_COOKIE_FLAG_ALWAYS_AUTOMATIC, /**< The cookie will be parsed and saved, and also attached to request automatically */
420 NET_HTTP_COOKIE_FLAG_ALWAYS_MANUAL /**< The cookie will be handled by the user action with Tizen::Net::Http::HttpRequest::SetCookie() and Tizen::Net::Http::HttpCookieStorageManager::GetCookies() */
424 * @enum NetHttpCertificateVerificationFlag
426 * Defines the certificate verification mode.
430 enum NetHttpCertificateVerificationFlag
432 HTTP_CV_FLAG_AUTOMATIC, /**< The certificate will be verified by system. If server certificate is invalid, the IHttpTransactionEventListener::OnTransactionCertVerificationRequiredN() listener is received. */
433 HTTP_CV_FLAG_MANUAL, /**< The certificate verification will be handled by user action when the IHttpTransactionEventListener::OnTransactionCertVerificationRequestedN() listener is received. */
434 HTTP_CV_FLAG_IGNORED, /**< The certificate verification will be ignored. */
437 } } } //Tizen::Net::Http
438 #endif // _FNET_HTTP_HTTP_TYPES_H_