namespace System.Net
{
-#if MOONLIGHT
- internal class HttpWebRequest : WebRequest, ISerializable {
-#else
[Serializable]
public class HttpWebRequest : WebRequest, ISerializable {
-#endif
Uri requestUri;
Uri actualUri;
bool hostChanged;
get { return allowBuffering; }
set { allowBuffering = value; }
}
+
+#if NET_4_5
+ public virtual bool AllowReadStreamBuffering {
+ get { return allowBuffering; }
+ set { allowBuffering = value; }
+ }
+#endif
static Exception GetMustImplement ()
{
set { continueDelegate = value; }
}
+#if NET_4_5
+ virtual
+#endif
public CookieContainer CookieContainer {
get { return cookieContainer; }
set { cookieContainer = value; }
}
}
#endif
+
+#if !NET_2_1
[MonoTODO]
public static new RequestCachePolicy DefaultCachePolicy
{
throw GetMustImplement ();
}
}
+#endif
[MonoTODO]
public static int DefaultMaximumErrorResponseLength
}
}
+#if NET_4_5
+ virtual
+#endif
public bool HaveResponse {
get { return haveResponse; }
}
if (idx >= 0)
return false;
+ IPAddress ipaddr;
+ if (IPAddress.TryParse (val, out ipaddr))
+ return true;
+
string u = scheme + "://" + val + "/";
return Uri.IsWellFormedUriString (u, UriKind.Absolute);
}
}
}
+#if NET_4_5
+ [MonoTODO]
+ public int ContinueTimeout {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+#endif
+
public string MediaType {
get { return mediaType; }
set {
internal ServicePoint ServicePointNoLock {
get { return servicePoint; }
}
-#if NET_4_5 || MOBILE
+#if NET_4_0
[MonoTODO ("for portable library support")]
- public bool SupportsCookieContainer {
+ public virtual bool SupportsCookieContainer {
get {
throw new NotImplementedException ();
}
lock (locker)
{
+ if (getResponseCalled)
+ throw new InvalidOperationException ("The operation cannot be performed once the request has been submitted.");
+
if (asyncWrite != null) {
throw new InvalidOperationException ("Cannot re-call start of asynchronous " +
"method while a previous call is still in progress.");
if (writeStream == null || writeStream.RequestWritten || !InternalAllowBuffering)
return;
#if NET_4_0
- if (contentLength < 0 && writeStream.CanWrite == true && writeStream.WriteBufferLength <= 0)
+ if (contentLength < 0 && writeStream.CanWrite == true && writeStream.WriteBufferLength < 0)
return;
- if (contentLength < 0 && writeStream.WriteBufferLength > 0)
+ if (contentLength < 0 && writeStream.WriteBufferLength >= 0)
InternalContentLength = writeStream.WriteBufferLength;
#else
if (contentLength < 0 && writeStream.CanWrite == true)
if (isProxy && (proxy == null || proxy.Credentials == null))
return false;
- string [] authHeaders = response.Headers.GetValues ( (isProxy) ? "Proxy-Authenticate" : "WWW-Authenticate");
+ string [] authHeaders = response.Headers.GetValues_internal ( (isProxy) ? "Proxy-Authenticate" : "WWW-Authenticate", false);
if (authHeaders == null || authHeaders.Length == 0)
return false;