[bcl] Add missing APIs for netstandard parity and expose a few APIs on mobile
[mono.git] / mcs / class / System / System.Net / HttpWebRequest.cs
index 25ea0ad05775d865591e4dff30253b49a6e61439..6a0aeb866cce320ace2968098e4498c8839bdebf 100644 (file)
@@ -133,7 +133,7 @@ namespace System.Net
                static HttpWebRequest ()
                {
                        defaultMaxResponseHeadersLength = 64 * 1024;
-#if !NET_2_1
+#if !MOBILE
                        NetConfig config = ConfigurationSettings.GetConfig ("system.net/settings") as NetConfig;
                        if (config != null) {
                                int x = config.MaxResponseHeadersLength;
@@ -145,7 +145,15 @@ namespace System.Net
 #endif
                }
 
-#if NET_2_1
+               [Obsolete ("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
+#if !BOOTSTRAP_BASIC
+               [System.ComponentModel.EditorBrowsable (System.ComponentModel.EditorBrowsableState.Never)]
+#endif
+               public HttpWebRequest ()
+               {
+               }
+
+#if MOBILE
                public
 #else
                internal
@@ -226,12 +234,12 @@ namespace System.Net
                        internal set { actualUri = value; } // Used by Ftp+proxy
                }
                
-               public bool AllowAutoRedirect {
+               public virtual bool AllowAutoRedirect {
                        get { return allowAutoRedirect; }
                        set { this.allowAutoRedirect = value; }
                }
                
-               public bool AllowWriteStreamBuffering {
+               public virtual bool AllowWriteStreamBuffering {
                        get { return allowBuffering; }
                        set { allowBuffering = value; }
                }
@@ -382,7 +390,7 @@ namespace System.Net
                                SetSpecialHeaders(headerName, HttpProtocolUtils.date2string(dateTime));
                }
 
-#if !NET_2_1
+#if !MOBILE
                [MonoTODO]
                public static new RequestCachePolicy DefaultCachePolicy
                {
@@ -450,7 +458,7 @@ namespace System.Net
                                        newWebHeaders.Add(headerName,webHeaders[headerName]);
                                }
 
-                               webHeaders = newWebHeaders;
+                               this.webHeaders = newWebHeaders;
                        }
                }
                
@@ -918,6 +926,12 @@ namespace System.Net
                        return EndGetRequestStream (asyncResult);
                }
 
+               [MonoTODO]
+               public Stream GetRequestStream (out TransportContext context)
+               {
+                       throw new NotImplementedException ();
+               }
+
                bool CheckIfForceWrite (SimpleAsyncResult result)
                {
                        if (writeStream == null || writeStream.RequestWritten || !InternalAllowBuffering)