|
|
@@ -34,12 +34,10 @@ using System.IO;
|
|
|
using System.Reflection;
|
|
|
using System.Runtime.Serialization;
|
|
|
using System.Globalization;
|
|
|
-#if NET_2_0
|
|
|
using System.Net.Configuration;
|
|
|
using System.Net.Security;
|
|
|
using System.Net.Cache;
|
|
|
using System.Security.Principal;
|
|
|
-#endif
|
|
|
|
|
|
#if NET_2_1
|
|
|
using ConfigurationException = System.ArgumentException;
|
|
|
@@ -58,12 +56,10 @@ namespace System.Net
|
|
|
public abstract class WebRequest : MarshalByRefObject, ISerializable {
|
|
|
#endif
|
|
|
static HybridDictionary prefixes = new HybridDictionary ();
|
|
|
-#if NET_2_0
|
|
|
static bool isDefaultWebProxySet;
|
|
|
static IWebProxy defaultWebProxy;
|
|
|
static RequestCachePolicy defaultCachePolicy;
|
|
|
static MethodInfo cfGetDefaultProxy;
|
|
|
-#endif
|
|
|
|
|
|
// Constructors
|
|
|
|
|
|
@@ -88,10 +84,8 @@ namespace System.Net
|
|
|
RegisterPrefix ("ftp", new FtpRequestCreator ());
|
|
|
#endif
|
|
|
#else
|
|
|
- #if NET_2_0
|
|
|
defaultCachePolicy = new HttpRequestCachePolicy (HttpRequestCacheLevel.NoCacheNoStore);
|
|
|
- #endif
|
|
|
- #if NET_2_0 && CONFIGURATION_DEP
|
|
|
+ #if CONFIGURATION_DEP
|
|
|
object cfg = ConfigurationManager.GetSection ("system.net/webRequestModules");
|
|
|
WebRequestModulesSection s = cfg as WebRequestModulesSection;
|
|
|
if (s != null) {
|
|
|
@@ -111,9 +105,6 @@ namespace System.Net
|
|
|
|
|
|
protected WebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)
|
|
|
{
|
|
|
-#if ONLY_1_1
|
|
|
- throw GetMustImplement ();
|
|
|
-#endif
|
|
|
}
|
|
|
|
|
|
static Exception GetMustImplement ()
|
|
|
@@ -123,7 +114,6 @@ namespace System.Net
|
|
|
|
|
|
// Properties
|
|
|
|
|
|
-#if NET_2_0
|
|
|
private AuthenticationLevel authentication_level = AuthenticationLevel.MutualAuthRequested;
|
|
|
|
|
|
public AuthenticationLevel AuthenticationLevel
|
|
|
@@ -143,7 +133,6 @@ namespace System.Net
|
|
|
set {
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
public virtual string ConnectionGroupName {
|
|
|
get { throw GetMustImplement (); }
|
|
|
@@ -165,7 +154,6 @@ namespace System.Net
|
|
|
set { throw GetMustImplement (); }
|
|
|
}
|
|
|
|
|
|
-#if NET_2_0
|
|
|
public static RequestCachePolicy DefaultCachePolicy
|
|
|
{
|
|
|
get { return defaultCachePolicy; }
|
|
|
@@ -173,14 +161,13 @@ namespace System.Net
|
|
|
throw GetMustImplement ();
|
|
|
}
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
public virtual WebHeaderCollection Headers {
|
|
|
get { throw GetMustImplement (); }
|
|
|
set { throw GetMustImplement (); }
|
|
|
}
|
|
|
|
|
|
-#if NET_2_0 && !MOONLIGHT
|
|
|
+#if !MOONLIGHT
|
|
|
public TokenImpersonationLevel ImpersonationLevel {
|
|
|
get { throw GetMustImplement (); }
|
|
|
set { throw GetMustImplement (); }
|
|
|
@@ -210,7 +197,6 @@ namespace System.Net
|
|
|
set { throw GetMustImplement (); }
|
|
|
}
|
|
|
|
|
|
-#if NET_2_0
|
|
|
public virtual bool UseDefaultCredentials
|
|
|
{
|
|
|
get {
|
|
|
@@ -272,7 +258,6 @@ namespace System.Net
|
|
|
return GetSystemWebProxy ();
|
|
|
#endif
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
// Methods
|
|
|
|
|
|
@@ -332,7 +317,6 @@ namespace System.Net
|
|
|
throw GetMustImplement ();
|
|
|
}
|
|
|
|
|
|
-#if NET_2_0
|
|
|
[MonoTODO("Look in other places for proxy config info")]
|
|
|
public static IWebProxy GetSystemWebProxy ()
|
|
|
{
|
|
|
@@ -366,22 +350,16 @@ namespace System.Net
|
|
|
|
|
|
return new WebProxy ();
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
- void ISerializable.GetObjectData
|
|
|
- (SerializationInfo serializationInfo,
|
|
|
- StreamingContext streamingContext)
|
|
|
+ void ISerializable.GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
|
|
|
{
|
|
|
throw new NotSupportedException ();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-#if NET_2_0
|
|
|
protected virtual void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
|
|
|
{
|
|
|
throw GetMustImplement ();
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
public static bool RegisterPrefix (string prefix, IWebRequestCreate creator)
|
|
|
{
|
|
|
@@ -451,4 +429,3 @@ namespace System.Net
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|