merge with master
[framework/osp/net.git] / inc / FNetHttpHttpTypes.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file                FNetHttpHttpTypes.h
20  * @brief               This is the header file for defining the primitive types for the HTTP operations.
21  *
22  * This header file contains the definition of the primitive types for the HTTP operations.
23  */
24
25 #ifndef _FNET_HTTP_HTTP_TYPES_H_
26 #define _FNET_HTTP_HTTP_TYPES_H_
27
28 #include "FBaseObject.h"
29 #include "FBaseColIComparer.h"
30 #include "FBaseString.h"
31 #include "FBaseErrorDefine.h"
32 #include "FBaseColIHashCodeProvider.h"
33
34 namespace Tizen { namespace Net { namespace Http
35 {
36
37 /**
38  * @enum    NetHttpMethod
39  *
40  * Defines the HTTP method types. For the detailed description of each method, refer to HttpRequest::SetMethod().
41  *
42  * @since 2.0
43  */
44 enum NetHttpMethod
45 {
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 */
54 };
55
56 /**
57  * @enum        NetHttpSessionMode
58  *
59  * Defines the HTTP session mode.
60  *
61  * @since 2.0
62  */
63 enum NetHttpSessionMode
64 {
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 */
68 };
69
70 /**
71  * @enum        HttpVersion
72  *
73  * Defines the HTTP version
74  *
75  * @since 2.0
76  */
77 enum HttpVersion
78 {
79         HTTP_VERSION_1_0,   /**< %Http version 1.0 */
80         HTTP_VERSION_1_1    /**< %Http version 1.1 */
81 };
82
83 /**
84  * @if OSPDEPREC
85  * @enum    NetHttpStatusCode
86  *
87  * Defines the HTTP status code.
88  *
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.
91  * @since 2.0
92  * @endif
93  */
94 enum NetHttpStatusCode
95 {
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 */
106
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 */
113
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 */
130
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 */
137 };
138
139 /**
140  * Status Code: 100 Continue
141  *
142  * @since 2.0
143  */
144 static const int HTTP_STATUS_CONTINUE = 100;
145 /**
146  * Status Code: 101 Switching Protocols
147  *
148  * @since 2.0
149  */
150 static const int HTTP_STATUS_SWITCHING_PROTOCOLS = 101;
151
152 /**
153  * Status Code: 200 OK
154  *
155  * @since 2.0
156  */
157 static const int HTTP_STATUS_OK = 200;
158 /**
159  * Status Code: 201 Created
160  *
161  * @since 2.0
162  */
163 static const int HTTP_STATUS_CREATED = 201;
164 /**
165  * Status Code: 202 Accepted
166  *
167  * @since 2.0
168  */
169 static const int HTTP_STATUS_ACCEPTED = 202;
170 /**
171  * Status Code: 203 Non-Authoritative Information
172  *
173  * @since 2.0
174  */
175 static const int HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION = 203;
176 /**
177  * Status Code: 204 No %Content
178  *
179  * @since 2.0
180  */
181 static const int HTTP_STATUS_NO_CONTENT = 204;
182 /**
183  * Status Code: 205 Reset %Content
184  *
185  * @since 2.0
186  */
187 static const int HTTP_STATUS_RESET_CONTENT = 205;
188 /**
189  * Status Code: 206 Partial %Content
190  *
191  * @since 2.0
192  */
193 static const int HTTP_STATUS_PARTIAL_CONTENT = 206;
194 /**
195  * Status Code: 300 Multiple Choices
196  *
197  * @since 2.0
198  */
199 static const int HTTP_STATUS_MULTIPLE_CHOICE = 300;
200 /**
201  * Status Code: 301 Moved Permanently
202  *
203  * @since 2.0
204  */
205 static const int HTTP_STATUS_MOVED_PERMANENTLY = 301;
206 /**
207  * Status Code: 302 Found
208  *
209  * @since 2.0
210  */
211 static const int HTTP_STATUS_FOUND = 302;
212 /**
213  * Status Code: 303 See Other
214  *
215  * @since 2.0
216  */
217 static const int HTTP_STATUS_SEE_OTHER = 303;
218 /**
219  * Status Code: 304 Not Modified
220  *
221  * @since 2.0
222  */
223 static const int HTTP_STATUS_NOT_MODIFIED = 304;
224 /**
225  * Status Code: 305 Use Proxy
226  *
227  * @since 2.0
228  */
229 static const int HTTP_STATUS_USE_PROXY = 305;
230 /**
231  * Status Code: 306 Switch Proxy
232  *
233  * @since 2.0
234  */
235 static const int HTTP_STATUS_SWITCH_PROXY = 306;
236 /**
237  * Status Code: 307 Temporary Redirect
238  *
239  * @since 2.0
240  */
241 static const int HTTP_STATUS_TEMPORARY_REDIRECT = 307;
242
243 /**
244  * Status Code: 400 Bad Request
245  *
246  * @since 2.0
247  */
248 static const int HTTP_STATUS_BAD_REQUEST = 400;
249 /**
250  * Status Code: 401 Unauthorized
251  *
252  * @since 2.0
253  */
254 static const int HTTP_STATUS_UNAUTHORIZED = 401;
255 /**
256  * Status Code: 402 Payment Required
257  *
258  * @since 2.0
259  */
260 static const int HTTP_STATUS_PAYMENT_REQUIRED = 402;
261 /**
262  * Status Code: 403 Forbidden
263  *
264  * @since 2.0
265  */
266 static const int HTTP_STATUS_FORBIDDEN = 403;
267 /**
268  * Status Code: 404 Not Found
269  *
270  * @since 2.0
271  */
272 static const int HTTP_STATUS_NOT_FOUND = 404;
273 /**
274  * Status Code: 405 Method Not Allowed
275  *
276  * @since 2.0
277  */
278 static const int HTTP_STATUS_METHOD_NOT_ALLOWED = 405;
279 /**
280  * Status Code: 406 Not Acceptable
281  *
282  * @since 2.0
283  */
284 static const int HTTP_STATUS_NOT_ACCEPTABLE = 406;
285 /**
286  * Status Code: 407 Proxy Authentication Required
287  *
288  * @since 2.0
289  */
290 static const int HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED = 407;
291 /**
292  * Status Code: 408 Request Timeout
293  *
294  * @since 2.0
295  */
296 static const int HTTP_STATUS_REQUEST_TIMEOUT = 408;
297 /**
298  * Status Code: 409 Conflict
299  *
300  * @since 2.0
301  */
302 static const int HTTP_STATUS_CONFLICT = 409;
303 /**
304  * Status Code: 410 Gone
305  *
306  * @since 2.0
307  */
308 static const int HTTP_STATUS_GONE = 410;
309 /**
310  * Status Code: 411 Length Required
311  *
312  * @since 2.0
313  */
314 static const int HTTP_STATUS_LENGTH_REQUIRED = 411;
315 /**
316  * Status Code: 412 Precondition Failed
317  *
318  * @since 2.0
319  */
320 static const int HTTP_STATUS_PRECONDITION_FAILED = 412;
321 /**
322  * Status Code: 413 Request Entity Too Large
323  *
324  * @since 2.0
325  */
326 static const int HTTP_STATUS_REQUEST_ENTITY_TOO_LARGE = 413;
327 /**
328  * Status Code: 414 Request-URI Too Long
329  *
330  * @since 2.0
331  */
332 static const int HTTP_STATUS_REQUEST_URI_TOO_LONG = 414;
333 /**
334  * Status Code: 415 Unsupported %Media Type
335  *
336  * @since 2.0
337  */
338 static const int HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415;
339 /**
340  * Status Code: 416 Requested Range Not Satisfiable
341  *
342  * @since 2.0
343  */
344 static const int HTTP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
345 /**
346  * Status Code: 417 Expectation Failed
347  *
348  * @since 2.0
349  */
350 static const int HTTP_STATUS_EXPECTATION_FAILED = 417;
351
352
353 /**
354  * Status Code: 500 Internal Server Error
355  *
356  * @since 2.0
357  */
358 static const int HTTP_STATUS_INTERNAL_SERVER_ERROR = 500;
359 /**
360  * Status Code: 501 Not Implemented
361  *
362  * @since 2.0
363  */
364 static const int HTTP_STATUS_NOT_IMPLEMENTED = 501;
365 /**
366  * Status Code: 502 Bad Gateway
367  *
368  * @since 2.0
369  */
370 static const int HTTP_STATUS_BAD_GATEWAY = 502;
371 /**
372  * Status Code: 503 Service Unavailable
373  *
374  * @since 2.0
375  */
376 static const int HTTP_STATUS_SERVICE_UNAVAILABLE = 503;
377 /**
378  * Status Code: 504 Gateway Timeout
379  *
380  * @since 2.0
381  */
382 static const int HTTP_STATUS_GATEWAY_TIMEOUT = 504;
383 /**
384  * Status Code: 505 HTTP Version Not Supported
385  *
386  * @since 2.0
387  */
388 static const int HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED = 505;
389
390 /**
391  * @enum    NetHttpAuthScheme
392  *
393  * Defines the supported authentication schemes.
394  *
395  * @since 2.0
396  */
397 enum NetHttpAuthScheme
398 {
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 */
407 };
408
409 /**
410  * @enum    NetHttpCookieFlag
411  *
412  * Defines the HTTP cookie mode.
413  *
414  * @since 2.0
415  */
416 enum  NetHttpCookieFlag
417 {
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() */
421 };
422
423 /**
424  * @enum    NetHttpCertificateVerificationFlag
425  *
426  * Defines the certificate verification mode.
427  *
428  * @since 2.1
429  */
430 enum  NetHttpCertificateVerificationFlag
431 {
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. */
435 };
436
437 } } } //Tizen::Net::Http
438 #endif // _FNET_HTTP_HTTP_TYPES_H_