1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Purpose: This file contains definitions of types THttpStatusCode,
15 // THttpParameter, THttpHeaderField, KHttpContentTypes,
16 // KHttpCharacterSetNames and KHttpCharacterSetCodes
17 // This header is a direct transcoding of [WSP] Appendix A - Assigned
18 // Numbers, which contains the following assignment tables:
19 // Table 34 : PDU Type Assignments
20 // 35 : Abort Reason Code Assignments
21 // 36 : Status Code Assignments
22 // 37 : Capability Assignments
23 // 38 : Well-Known Parameter Assignments
24 // 39 : Header Field Name Assignments
25 // 40 : Content-Type Assignments
26 // 41 : ISO-639 Language Assignments
27 // 42 : Character Set Assignments
31 #if !defined(__THTTPFIELDS_H__)
32 #define __THTTPFIELDS_H__
35 // Table 34 not implemented
40 // Table 35 not implemented
45 HTTP/1.1 Status Codes: WSP Code Assignments
47 (see [WSP] Appdx A Table 36)
48 Codes from RFC-2616 added where necessary for HTTP Caching
56 EHttpSwitchingProtocols,
57 EHttpWarnStaleContent = 110, // From RFC-2616
58 EHttpWarnRevalidationFailed, // "
59 EHttpWarnDisconnectedOperation, // "
60 EHttpWarnHeuristicExpiration, // "
61 EHttpWarnMiscellaneous, // "
65 EHttpNonAuthorativeInformation,
69 EHttpWarnTransformationApplied, // From RFC-2616
70 EHttpWarnPersistentMiscellanous, // "
71 EHttpMultipleChoices = 300,
72 EHttpMovedPermanently,
73 EHttpMovedTemporarily,
77 EHttpTemporaryRedirect = 307, // From RFC-2616
78 EHttpBadRequest = 400,
83 EHttpMethodNotAllowed,
85 EHttpProxyAuthenticationRequired,
90 EHttpPreconditionFailed,
91 EHttpRequestEntityTooLarge,
92 EHttpRequestURITooLong,
93 EHttpUnsupportedMediaType,
94 EHttpRequestRangeNotSatisfiable, // From RFC-2616
95 EHttpExpectationFailed, // From RFC-2616
96 EHttpInternalServerError = 500,
99 EHttpServiceUnavailable,
101 EHttpHTTPVersionNotSupported
102 // All other codes are extension codes
107 // Table 37 not implemented
112 HTTP/1.1 Parameters: WSP Well-known Parameter Assignments
114 (see [WSP] Appdx A Table 38)
125 EHttpFilename = 0x05,
126 EHttpDifferences = 0x06,
132 HTTP/1.1 Headers: WSP Field Name Assignments
134 (see [WSP] Appdx A Table 39)
138 enum THttpHeaderField
148 EHttpCacheControl = 0x08,
151 EHttpContentEncoding,
152 EHttpContentLanguage,
154 EHttpContentLocation,
156 EHttpContentRange = 0x10,
163 EHttpIfModifiedSince,
167 EHttpIfUnmodifiedSince,
172 EHttpProxyAuthenticate = 0x20,
173 EHttpProxyAuthorization,
179 EHttpTransferEncoding,
185 EHttpWWWAuthenticate,
186 EHttpContentDisposition,
187 EHttpXWapApplicationID = 0x2F, // Additional Enums required for WAP1.2 Push
189 EHttpXWapInitiatorURI,
190 EHttpAcceptApplication,
191 EHttpBearerIndication,
200 // WSP Content-Type Assignments
202 // (see [WSP] Appdx A Table 40)
208 const TInt KHttpNumContentTypes = 77;
214 const TInt KHttpMaxLenghtOfContentType = 42;
220 static const TText8* const KHttpContentTypes[] =
228 _S8("text/x-vCalendar"),
230 _S8("text/vnd.wap.wml"), // 0x08
231 _S8("text/vnd.wap.wmlscript"),
232 _S8("application/vnd.wap.catc"),
234 _S8("Multipart/mixed"),
235 _S8("Multipart/form-data"),
236 _S8("Multipart/byteranges"),
237 _S8("multipart/alternative"),
238 _S8("application/*"), // 0x10
239 _S8("application/java-vm"),
240 _S8("application/x-www-form-urlencoded"),
241 _S8("application/x-hdmlc"),
242 _S8("application/vnd.wap.wmlc"),
243 _S8("application/vnd.wap.wmlscriptc"),
244 _S8("application/vnd.wap.wsic"),
245 _S8("application/vnd.wap.uaprof"),
246 _S8("application/vnd.wap.wtls-ca-certificate"), // 0x18
247 _S8("application/vnd.wap.wtls-user-certificate"),
248 _S8("application/x-x509-ca-cert"),
249 _S8("application/x-x509-user-cert"),
254 _S8("image/png"), // 0x20
255 _S8("image/vnd.wap.wbmp"),
256 _S8("application/vnd.wap.multipart.*"),
257 _S8("application/vnd.wap.multipart.mixed"),
258 _S8("application/vnd.wap.multipart.form-data"),
259 _S8("application/vnd.wap.multipart.byteranges"),
260 _S8("application/vnd.wap.multipart.alternative"),
261 _S8("application/xml"),
262 _S8("text/xml"), // 0x28
263 _S8("application/vnd.wap.wbxml"),
264 _S8("application/x-x968-cross-cert"), //Additional C-Types in WAP 1.2
265 _S8("application/x-x968-ca-cert"),
266 _S8("application/x-x968-user-cert"),
267 _S8("text/vnd.wap.si"),
268 _S8("application/vnd.wap.sic"),
269 _S8("text/vnd.wap.sl"),
270 _S8("application/vnd.wap.slc"), //0x30
271 _S8("text/vnd.wap.co"),
272 _S8("application/vnd.wap.coc"),
273 _S8("application/vnd.wap.multipart.related"),
274 _S8("application/vnd.wap.sia"), //0x34 or 52 in decimal
275 _S8("text/vnd.wap.connectivity-xml"),
276 _S8("application/vnd.wap.connectivity-wbxml"),
277 _S8("application/pkcs7-mime"),
278 _S8("application/vnd.wap.hashed-certificate"),
279 _S8("application/vnd.wap.signed-certificate"),
280 _S8("application/vnd.wap.cert-response"),
281 _S8("application/xhtml+xml"),
282 _S8("application/wml+xml"),
284 _S8("application/vnd.wap.mms-message"),
285 _S8("application/vnd.wap.rollover-certificate"),
286 _S8("application/vnd.wap.locc+wbxml"),
287 _S8("application/vnd.wap.loc+xml"),
288 _S8("application/vnd.syncml.dm+wbxml"),
289 _S8("application/vnd.syncml.dm+xml"),
290 _S8("application/vnd.syncml.notification"),
291 _S8("application/vnd.wap.xhtml+xml"),
292 _S8("application/vnd.wv.csp.cir"),
293 _S8("application/vnd.oma.dd+xml"),
294 _S8("application/vnd.oma.drm.message"),
295 _S8("application/vnd.oma.drm.content"),
296 _S8("application/vnd.oma.drm.rights+xml"),
297 _S8("application/vnd.oma.drm.rights+wbxml"),
298 _S8("application/vnd.oma.drm.roap-trigger+xml"),
299 _S8("application/vnd.oma.drm.roap-trigger+wbxml"),//0x4D
304 // Table 41. Languages
310 const TInt KHttpNumLanguages = 0x8D;
316 static const TText8* const KHttpLanguages[] =
325 _S8("AZERBAIJANI AZ"),
327 _S8("BYELORUSSIAN BE"),
331 _S8("BENGALI BANGLA BN"),
347 _S8("PERSIAN farsi FA"),
354 _S8("SCOTS-GAELIC GD"),
364 _S8("VIETNAMESE VI"),
365 _S8("INDONESIAN ID"),
385 _S8("LITHUANIAN LT"),
386 _S8("LATVIAN LETTISH LV"),
389 _S8("MACEDONIAN MK"),
402 _S8("AFAN OROMO OM"),
406 _S8("PASHTO PUSHTO PS"),
407 _S8("PORTUGUESE PT"),
413 _S8("KINYARWANDA RW"),
417 _S8("SERBO-CROATIAN SH"),
418 _S8("SINGHALESE SI"),
449 _S8("INTERLINGUA IA"),
451 _S8("INTERLINGUE IE"),
455 _S8("GREENLANDIC KL"),
457 _S8("RHAETO-ROMANCE RM")
461 // WSP Character Set Assignments
463 // (see [WSP] Appdx A Table 42)
465 // The following two arrays form a paired look-up table
471 const TInt KHttpNumCharacterSets = 15;
477 static const TText8* const KHttpCharacterSetNames[] =
480 _S8("iso-10646-ucs-2"),
493 _S8("gsm-default-alphabet") // (not yet assigned)
500 static const TInt KHttpCharacterSetCodes[] =
503 0x03e8, // iso-10646-ucs-2
516 0xffff // gsm-default-alphabet (not yet assigned)
521 Additional enumeration implementations for well known field values
522 that may be found in the Cache-Control header
523 As described in section 14.9 of RFC-2616
524 Assigned WSP encodings
528 enum TCacheControlFieldValue
530 ECacheControlNoCache = 0x80,// "no-cache"
531 ECacheCtrlNoStore, // "no-store"
532 ECacheCtrlMaxAge, // "max-age"
533 ECacheCtrlMaxStale, // "max-stale"
534 ECacheCtrlMinFresh, // "min-fresh"
535 ECacheCtrlOnlyIfCached, // "only-if-cached"
536 ECacheCtrlPublic, // "public"
537 ECacheCtrlPrivate, // "private"
538 ECacheCtrlNoTransform, // "no-transform"
539 ECacheCtrlMustRevalidate, // "must-revalidate"
540 ECacheCtrlProxyRevalidate, // "proxy-revalidate"
541 ECacheCtrlCacheExtension // "cache-extension"
544 #endif // __THTTPFIELDS_H__