1 using System.Collections;
5 static partial class UnsafeNclNativeMethods
7 internal static unsafe class HttpApi
9 const int HttpHeaderRequestMaximum = (int)HttpRequestHeader.UserAgent + 1;
10 const int HttpHeaderResponseMaximum = (int)HttpResponseHeader.WwwAuthenticate + 1;
12 internal static class HTTP_REQUEST_HEADER_ID {
13 internal static string ToString(int position) {
14 return m_Strings[position];
17 private static string[] m_Strings = {
54 "If-Unmodified-Since",
56 "Proxy-Authorization",
65 internal static class HTTP_RESPONSE_HEADER_ID {
66 private static Hashtable m_Hashtable;
68 static HTTP_RESPONSE_HEADER_ID() {
69 m_Hashtable = new Hashtable((int)Enum.HttpHeaderResponseMaximum);
70 for (int i = 0; i < (int)Enum.HttpHeaderResponseMaximum; i++) {
71 m_Hashtable.Add(m_Strings[i], i);
75 internal static int IndexOfKnownHeader(string HeaderName) {
76 object index = m_Hashtable[HeaderName];
77 return index==null ? -1 : (int)index;
80 internal static string ToString(int position) {
81 return m_Strings[position];
86 HttpHeaderCacheControl = 0, // general-header [section 4.5]
87 HttpHeaderConnection = 1, // general-header [section 4.5]
88 HttpHeaderDate = 2, // general-header [section 4.5]
89 HttpHeaderKeepAlive = 3, // general-header [not in rfc]
90 HttpHeaderPragma = 4, // general-header [section 4.5]
91 HttpHeaderTrailer = 5, // general-header [section 4.5]
92 HttpHeaderTransferEncoding = 6, // general-header [section 4.5]
93 HttpHeaderUpgrade = 7, // general-header [section 4.5]
94 HttpHeaderVia = 8, // general-header [section 4.5]
95 HttpHeaderWarning = 9, // general-header [section 4.5]
97 HttpHeaderAllow = 10, // entity-header [section 7.1]
98 HttpHeaderContentLength = 11, // entity-header [section 7.1]
99 HttpHeaderContentType = 12, // entity-header [section 7.1]
100 HttpHeaderContentEncoding = 13, // entity-header [section 7.1]
101 HttpHeaderContentLanguage = 14, // entity-header [section 7.1]
102 HttpHeaderContentLocation = 15, // entity-header [section 7.1]
103 HttpHeaderContentMd5 = 16, // entity-header [section 7.1]
104 HttpHeaderContentRange = 17, // entity-header [section 7.1]
105 HttpHeaderExpires = 18, // entity-header [section 7.1]
106 HttpHeaderLastModified = 19, // entity-header [section 7.1]
111 HttpHeaderAcceptRanges = 20, // response-header [section 6.2]
112 HttpHeaderAge = 21, // response-header [section 6.2]
113 HttpHeaderEtag = 22, // response-header [section 6.2]
114 HttpHeaderLocation = 23, // response-header [section 6.2]
115 HttpHeaderProxyAuthenticate = 24, // response-header [section 6.2]
116 HttpHeaderRetryAfter = 25, // response-header [section 6.2]
117 HttpHeaderServer = 26, // response-header [section 6.2]
118 HttpHeaderSetCookie = 27, // response-header [not in rfc]
119 HttpHeaderVary = 28, // response-header [section 6.2]
120 HttpHeaderWwwAuthenticate = 29, // response-header [section 6.2]
122 HttpHeaderResponseMaximum = 30,
125 HttpHeaderMaximum = 41
128 private static string[] m_Strings = {
155 "Proxy-Authenticate",