Enable the System build for monodroid
[mono.git] / mcs / class / System / System.Net / WebRequest.cs
index 06f3c72b4dc1e7deb8f15c71fe01b61fba5c7259..533dd17f7a6475f2cca1ddd73b8cddf81724bd22 100644 (file)
@@ -60,6 +60,7 @@ namespace System.Net
 #if NET_2_0
                static bool isDefaultWebProxySet;
                static IWebProxy defaultWebProxy;
+               static RequestCachePolicy defaultCachePolicy;
 #endif
                
                // Constructors
@@ -69,11 +70,14 @@ namespace System.Net
 #if NET_2_1
                        AddPrefix ("http", typeof (HttpRequestCreator));
                        AddPrefix ("https", typeof (HttpRequestCreator));
-       #if MONOTOUCH
+       #if MOBILE
                        AddPrefix ("file", typeof (FileWebRequestCreator));
                        AddPrefix ("ftp", typeof (FtpRequestCreator));
        #endif
 #else
+       #if NET_2_0
+                       defaultCachePolicy = new HttpRequestCachePolicy (HttpRequestCacheLevel.NoCacheNoStore);
+       #endif
        #if NET_2_0 && CONFIGURATION_DEP
                        object cfg = ConfigurationManager.GetSection ("system.net/webRequestModules");
                        WebRequestModulesSection s = cfg as WebRequestModulesSection;
@@ -119,11 +123,10 @@ namespace System.Net
                        }
                }
 
+               [MonoTODO ("Implement the caching system. Currently always returns a policy with the NoCacheNoStore level")]
                public virtual RequestCachePolicy CachePolicy
                {
-                       get {
-                               throw GetMustImplement ();
-                       }
+                       get { return DefaultCachePolicy; }
                        set {
                        }
                }
@@ -152,9 +155,7 @@ namespace System.Net
 #if NET_2_0
                public static RequestCachePolicy DefaultCachePolicy
                {
-                       get {
-                               throw GetMustImplement ();
-                       }
+                       get { return defaultCachePolicy; }
                        set {
                                throw GetMustImplement ();
                        }