Files
2026-06-04 11:42:34 +02:00

705 lines
36 KiB
C#

using System;
using System.Collections;
using System.Collections.Specialized;
using System.Globalization;
using System.IO;
using System.Net.Cache;
using System.Net.Security;
using System.Runtime.Serialization;
using System.Security.Principal;
namespace System.Net
{
/// <summary>Makes a request to a Uniform Resource Identifier (URI). This is an abstract class.</summary>
// Token: 0x0200026F RID: 623
[Serializable]
public abstract class WebRequest : MarshalByRefObject, ISerializable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Net.WebRequest" /> class.</summary>
// Token: 0x0600170A RID: 5898 RVA: 0x0004D9F8 File Offset: 0x0004BBF8
protected WebRequest()
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Net.WebRequest" /> class from the specified instances of the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> and <see cref="T:System.Runtime.Serialization.StreamingContext" /> classes.</summary>
/// <param name="serializationInfo">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that contains the information required to serialize the new <see cref="T:System.Net.WebRequest" /> instance. </param>
/// <param name="streamingContext">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> that indicates the source of the serialized stream associated with the new <see cref="T:System.Net.WebRequest" /> instance. </param>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to access the constructor, when the constructor is not overridden in a descendant class. </exception>
// Token: 0x0600170B RID: 5899 RVA: 0x0004DA08 File Offset: 0x0004BC08
protected WebRequest(SerializationInfo serializationInfo, StreamingContext streamingContext)
{
}
// Token: 0x0600170C RID: 5900 RVA: 0x0004DA18 File Offset: 0x0004BC18
static WebRequest()
{
WebRequest.AddDynamicPrefix("http", "HttpRequestCreator");
WebRequest.AddDynamicPrefix("https", "HttpRequestCreator");
WebRequest.AddDynamicPrefix("file", "FileWebRequestCreator");
WebRequest.AddDynamicPrefix("ftp", "FtpRequestCreator");
}
/// <summary>When overridden in a descendant class, populates a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> instance with the data needed to serialize the <see cref="T:System.Net.WebRequest" />.</summary>
/// <param name="serializationInfo">A <see cref="T:System.Runtime.Serialization.SerializationInfo" />, which holds the serialized data for the <see cref="T:System.Net.WebRequest" />. </param>
/// <param name="streamingContext">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains the destination of the serialized stream associated with the new <see cref="T:System.Net.WebRequest" />. </param>
/// <exception cref="T:System.NotImplementedException">An attempt is made to serialize the object, when the interface is not overridden in a descendant class. </exception>
// Token: 0x0600170D RID: 5901 RVA: 0x0004DA78 File Offset: 0x0004BC78
void ISerializable.GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
{
throw new NotSupportedException();
}
// Token: 0x0600170E RID: 5902 RVA: 0x0004DA80 File Offset: 0x0004BC80
private static void AddDynamicPrefix(string protocol, string implementor)
{
Type type = typeof(WebRequest).Assembly.GetType("System.Net." + implementor);
if (type == null)
{
return;
}
WebRequest.AddPrefix(protocol, type);
}
// Token: 0x0600170F RID: 5903 RVA: 0x0004DABC File Offset: 0x0004BCBC
private static Exception GetMustImplement()
{
return new NotImplementedException("This method must be implemented in derived classes");
}
/// <summary>Gets or sets values indicating the level of authentication and impersonation used for this request.</summary>
/// <returns>A bitwise combination of the <see cref="T:System.Net.Security.AuthenticationLevel" /> values. The default value is <see cref="F:System.Net.Security.AuthenticationLevel.MutualAuthRequested" />.In mutual authentication, both the client and server present credentials to establish their identity. The <see cref="F:System.Net.Security.AuthenticationLevel.MutualAuthRequired" /> and <see cref="F:System.Net.Security.AuthenticationLevel.MutualAuthRequested" /> values are relevant for Kerberos authentication. Kerberos authentication can be supported directly, or can be used if the Negotiate security protocol is used to select the actual security protocol. For more information about authentication protocols, see Internet Authentication.To determine whether mutual authentication occurred, check the <see cref="P:System.Net.WebResponse.IsMutuallyAuthenticated" /> property. If you specify the <see cref="F:System.Net.Security.AuthenticationLevel.MutualAuthRequired" /> authentication flag value and mutual authentication does not occur, your application will receive an <see cref="T:System.IO.IOException" /> with a <see cref="T:System.Net.ProtocolViolationException" /> inner exception indicating that mutual authentication failed.</returns>
// Token: 0x17000754 RID: 1876
// (get) Token: 0x06001710 RID: 5904 RVA: 0x0004DAC8 File Offset: 0x0004BCC8
// (set) Token: 0x06001711 RID: 5905 RVA: 0x0004DAD0 File Offset: 0x0004BCD0
public global::System.Net.Security.AuthenticationLevel AuthenticationLevel
{
get
{
return this.authentication_level;
}
set
{
this.authentication_level = value;
}
}
/// <summary>Gets or sets the cache policy for this request.</summary>
/// <returns>A <see cref="T:System.Net.Cache.RequestCachePolicy" /> object that defines a cache policy.</returns>
// Token: 0x17000755 RID: 1877
// (get) Token: 0x06001712 RID: 5906 RVA: 0x0004DADC File Offset: 0x0004BCDC
// (set) Token: 0x06001713 RID: 5907 RVA: 0x0004DAE4 File Offset: 0x0004BCE4
public virtual global::System.Net.Cache.RequestCachePolicy CachePolicy
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
}
}
/// <summary>When overridden in a descendant class, gets or sets the name of the connection group for the request.</summary>
/// <returns>The name of the connection group for the request.</returns>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x17000756 RID: 1878
// (get) Token: 0x06001714 RID: 5908 RVA: 0x0004DAE8 File Offset: 0x0004BCE8
// (set) Token: 0x06001715 RID: 5909 RVA: 0x0004DAF0 File Offset: 0x0004BCF0
public virtual string ConnectionGroupName
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>When overridden in a descendant class, gets or sets the content length of the request data being sent.</summary>
/// <returns>The number of bytes of request data being sent.</returns>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x17000757 RID: 1879
// (get) Token: 0x06001716 RID: 5910 RVA: 0x0004DAF8 File Offset: 0x0004BCF8
// (set) Token: 0x06001717 RID: 5911 RVA: 0x0004DB00 File Offset: 0x0004BD00
public virtual long ContentLength
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>When overridden in a descendant class, gets or sets the content type of the request data being sent.</summary>
/// <returns>The content type of the request data.</returns>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x17000758 RID: 1880
// (get) Token: 0x06001718 RID: 5912 RVA: 0x0004DB08 File Offset: 0x0004BD08
// (set) Token: 0x06001719 RID: 5913 RVA: 0x0004DB10 File Offset: 0x0004BD10
public virtual string ContentType
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>When overridden in a descendant class, gets or sets the network credentials used for authenticating the request with the Internet resource.</summary>
/// <returns>An <see cref="T:System.Net.ICredentials" /> containing the authentication credentials associated with the request. The default is null.</returns>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x17000759 RID: 1881
// (get) Token: 0x0600171A RID: 5914 RVA: 0x0004DB18 File Offset: 0x0004BD18
// (set) Token: 0x0600171B RID: 5915 RVA: 0x0004DB20 File Offset: 0x0004BD20
public virtual ICredentials Credentials
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>Gets or sets the default cache policy for this request.</summary>
/// <returns>A <see cref="T:System.Net.Cache.HttpRequestCachePolicy" /> that specifies the cache policy in effect for this request when no other policy is applicable.</returns>
// Token: 0x1700075A RID: 1882
// (get) Token: 0x0600171C RID: 5916 RVA: 0x0004DB28 File Offset: 0x0004BD28
// (set) Token: 0x0600171D RID: 5917 RVA: 0x0004DB30 File Offset: 0x0004BD30
public static global::System.Net.Cache.RequestCachePolicy DefaultCachePolicy
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>When overridden in a descendant class, gets or sets the collection of header name/value pairs associated with the request.</summary>
/// <returns>A <see cref="T:System.Net.WebHeaderCollection" /> containing the header name/value pairs associated with this request.</returns>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x1700075B RID: 1883
// (get) Token: 0x0600171E RID: 5918 RVA: 0x0004DB38 File Offset: 0x0004BD38
// (set) Token: 0x0600171F RID: 5919 RVA: 0x0004DB40 File Offset: 0x0004BD40
public virtual WebHeaderCollection Headers
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>Gets or sets the impersonation level for the current request.</summary>
/// <returns>A <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> value.</returns>
// Token: 0x1700075C RID: 1884
// (get) Token: 0x06001720 RID: 5920 RVA: 0x0004DB48 File Offset: 0x0004BD48
// (set) Token: 0x06001721 RID: 5921 RVA: 0x0004DB50 File Offset: 0x0004BD50
public TokenImpersonationLevel ImpersonationLevel
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>When overridden in a descendant class, gets or sets the protocol method to use in this request.</summary>
/// <returns>The protocol method to use in this request.</returns>
/// <exception cref="T:System.NotImplementedException">If the property is not overridden in a descendant class, any attempt is made to get or set the property. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x1700075D RID: 1885
// (get) Token: 0x06001722 RID: 5922 RVA: 0x0004DB58 File Offset: 0x0004BD58
// (set) Token: 0x06001723 RID: 5923 RVA: 0x0004DB60 File Offset: 0x0004BD60
public virtual string Method
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>When overridden in a descendant class, indicates whether to pre-authenticate the request.</summary>
/// <returns>true to pre-authenticate; otherwise, false.</returns>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x1700075E RID: 1886
// (get) Token: 0x06001724 RID: 5924 RVA: 0x0004DB68 File Offset: 0x0004BD68
// (set) Token: 0x06001725 RID: 5925 RVA: 0x0004DB70 File Offset: 0x0004BD70
public virtual bool PreAuthenticate
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>When overridden in a descendant class, gets or sets the network proxy to use to access this Internet resource.</summary>
/// <returns>The <see cref="T:System.Net.IWebProxy" /> to use to access the Internet resource.</returns>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x1700075F RID: 1887
// (get) Token: 0x06001726 RID: 5926 RVA: 0x0004DB78 File Offset: 0x0004BD78
// (set) Token: 0x06001727 RID: 5927 RVA: 0x0004DB80 File Offset: 0x0004BD80
public virtual IWebProxy Proxy
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>When overridden in a descendant class, gets the URI of the Internet resource associated with the request.</summary>
/// <returns>A <see cref="T:System.Uri" /> representing the resource associated with the request </returns>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x17000760 RID: 1888
// (get) Token: 0x06001728 RID: 5928 RVA: 0x0004DB88 File Offset: 0x0004BD88
public virtual global::System.Uri RequestUri
{
get
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>Gets or sets the length of time, in milliseconds, before the request times out.</summary>
/// <returns>The length of time, in milliseconds, until the request times out, or the value <see cref="F:System.Threading.Timeout.Infinite" /> to indicate that the request does not time out. The default value is defined by the descendant class.</returns>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x17000761 RID: 1889
// (get) Token: 0x06001729 RID: 5929 RVA: 0x0004DB90 File Offset: 0x0004BD90
// (set) Token: 0x0600172A RID: 5930 RVA: 0x0004DB98 File Offset: 0x0004BD98
public virtual int Timeout
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>When overridden in a descendant class, gets or sets a <see cref="T:System.Boolean" /> value that controls whether <see cref="P:System.Net.CredentialCache.DefaultCredentials" /> are sent with requests.</summary>
/// <returns>true if the default credentials are used; otherwise false. The default value is false.</returns>
/// <exception cref="T:System.InvalidOperationException">You attempted to set this property after the request was sent.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x17000762 RID: 1890
// (get) Token: 0x0600172B RID: 5931 RVA: 0x0004DBA0 File Offset: 0x0004BDA0
// (set) Token: 0x0600172C RID: 5932 RVA: 0x0004DBA8 File Offset: 0x0004BDA8
public virtual bool UseDefaultCredentials
{
get
{
throw WebRequest.GetMustImplement();
}
set
{
throw WebRequest.GetMustImplement();
}
}
/// <summary>Gets or sets the global HTTP proxy.</summary>
/// <returns>An <see cref="T:System.Net.IWebProxy" /> used by every call to instances of <see cref="T:System.Net.WebRequest" />.</returns>
// Token: 0x17000763 RID: 1891
// (get) Token: 0x0600172D RID: 5933 RVA: 0x0004DBB0 File Offset: 0x0004BDB0
// (set) Token: 0x0600172E RID: 5934 RVA: 0x0004DC14 File Offset: 0x0004BE14
public static IWebProxy DefaultWebProxy
{
get
{
if (!WebRequest.isDefaultWebProxySet)
{
object obj = WebRequest.lockobj;
lock (obj)
{
if (WebRequest.defaultWebProxy == null)
{
WebRequest.defaultWebProxy = WebRequest.GetDefaultWebProxy();
}
}
}
return WebRequest.defaultWebProxy;
}
set
{
WebRequest.defaultWebProxy = value;
WebRequest.isDefaultWebProxySet = true;
}
}
// Token: 0x0600172F RID: 5935 RVA: 0x0004DC24 File Offset: 0x0004BE24
[global::System.MonoTODO("Needs to respect Module, Proxy.AutoDetect, and Proxy.ScriptLocation config settings")]
private static IWebProxy GetDefaultWebProxy()
{
return null;
}
/// <summary>Aborts the Request </summary>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001730 RID: 5936 RVA: 0x0004DC34 File Offset: 0x0004BE34
public virtual void Abort()
{
throw WebRequest.GetMustImplement();
}
/// <summary>When overridden in a descendant class, provides an asynchronous version of the <see cref="M:System.Net.WebRequest.GetRequestStream" /> method.</summary>
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous request.</returns>
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
/// <param name="state">An object containing state information for this asynchronous request. </param>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class. </exception>
// Token: 0x06001731 RID: 5937 RVA: 0x0004DC3C File Offset: 0x0004BE3C
public virtual IAsyncResult BeginGetRequestStream(AsyncCallback callback, object state)
{
throw WebRequest.GetMustImplement();
}
/// <summary>When overridden in a descendant class, begins an asynchronous request for an Internet resource.</summary>
/// <returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous request.</returns>
/// <param name="callback">The <see cref="T:System.AsyncCallback" /> delegate. </param>
/// <param name="state">An object containing state information for this asynchronous request. </param>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class. </exception>
// Token: 0x06001732 RID: 5938 RVA: 0x0004DC44 File Offset: 0x0004BE44
public virtual IAsyncResult BeginGetResponse(AsyncCallback callback, object state)
{
throw WebRequest.GetMustImplement();
}
/// <summary>Initializes a new <see cref="T:System.Net.WebRequest" /> instance for the specified URI scheme.</summary>
/// <returns>A <see cref="T:System.Net.WebRequest" /> descendant for the specific URI scheme.</returns>
/// <param name="requestUriString">The URI that identifies the Internet resource. </param>
/// <exception cref="T:System.NotSupportedException">The request scheme specified in <paramref name="requestUriString" /> has not been registered. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="requestUriString" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have permission to connect to the requested URI or a URI that the request is redirected to. </exception>
/// <exception cref="T:System.UriFormatException">The URI specified in <paramref name="requestUriString" /> is not a valid URI. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001733 RID: 5939 RVA: 0x0004DC4C File Offset: 0x0004BE4C
public static WebRequest Create(string requestUriString)
{
if (requestUriString == null)
{
throw new ArgumentNullException("requestUriString");
}
return WebRequest.Create(new global::System.Uri(requestUriString));
}
/// <summary>Initializes a new <see cref="T:System.Net.WebRequest" /> instance for the specified URI scheme.</summary>
/// <returns>A <see cref="T:System.Net.WebRequest" /> descendant for the specified URI scheme.</returns>
/// <param name="requestUri">A <see cref="T:System.Uri" /> containing the URI of the requested resource. </param>
/// <exception cref="T:System.NotSupportedException">The request scheme specified in <paramref name="requestUri" /> is not registered. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="requestUri" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have permission to connect to the requested URI or a URI that the request is redirected to. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001734 RID: 5940 RVA: 0x0004DC6C File Offset: 0x0004BE6C
public static WebRequest Create(global::System.Uri requestUri)
{
if (requestUri == null)
{
throw new ArgumentNullException("requestUri");
}
return WebRequest.GetCreator(requestUri.AbsoluteUri).Create(requestUri);
}
/// <summary>Initializes a new <see cref="T:System.Net.WebRequest" /> instance for the specified URI scheme.</summary>
/// <returns>A <see cref="T:System.Net.WebRequest" /> descendant for the specified URI scheme.</returns>
/// <param name="requestUri">A <see cref="T:System.Uri" /> containing the URI of the requested resource. </param>
/// <exception cref="T:System.NotSupportedException">The request scheme specified in <paramref name="requestUri" /> is not registered. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="requestUri" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have permission to connect to the requested URI or a URI that the request is redirected to. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001735 RID: 5941 RVA: 0x0004DCA4 File Offset: 0x0004BEA4
public static WebRequest CreateDefault(global::System.Uri requestUri)
{
if (requestUri == null)
{
throw new ArgumentNullException("requestUri");
}
return WebRequest.GetCreator(requestUri.Scheme).Create(requestUri);
}
/// <summary>When overridden in a descendant class, returns a <see cref="T:System.IO.Stream" /> for writing data to the Internet resource.</summary>
/// <returns>A <see cref="T:System.IO.Stream" /> to write data to.</returns>
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that references a pending request for a stream. </param>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class. </exception>
// Token: 0x06001736 RID: 5942 RVA: 0x0004DCDC File Offset: 0x0004BEDC
public virtual Stream EndGetRequestStream(IAsyncResult asyncResult)
{
throw WebRequest.GetMustImplement();
}
/// <summary>When overridden in a descendant class, returns a <see cref="T:System.Net.WebResponse" />.</summary>
/// <returns>A <see cref="T:System.Net.WebResponse" /> that contains a response to the Internet request.</returns>
/// <param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that references a pending request for a response. </param>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class. </exception>
// Token: 0x06001737 RID: 5943 RVA: 0x0004DCE4 File Offset: 0x0004BEE4
public virtual WebResponse EndGetResponse(IAsyncResult asyncResult)
{
throw WebRequest.GetMustImplement();
}
/// <summary>When overridden in a descendant class, returns a <see cref="T:System.IO.Stream" /> for writing data to the Internet resource.</summary>
/// <returns>A <see cref="T:System.IO.Stream" /> for writing data to the Internet resource.</returns>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001738 RID: 5944 RVA: 0x0004DCEC File Offset: 0x0004BEEC
public virtual Stream GetRequestStream()
{
throw WebRequest.GetMustImplement();
}
/// <summary>When overridden in a descendant class, returns a response to an Internet request.</summary>
/// <returns>A <see cref="T:System.Net.WebResponse" /> containing the response to the Internet request.</returns>
/// <exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001739 RID: 5945 RVA: 0x0004DCF4 File Offset: 0x0004BEF4
public virtual WebResponse GetResponse()
{
throw WebRequest.GetMustImplement();
}
/// <summary>Returns a proxy configured with the Internet Explorer settings of the currently impersonated user.</summary>
/// <returns>An <see cref="T:System.Net.IWebProxy" /> used by every call to instances of <see cref="T:System.Net.WebRequest" />.</returns>
// Token: 0x0600173A RID: 5946 RVA: 0x0004DCFC File Offset: 0x0004BEFC
[global::System.MonoTODO("Look in other places for proxy config info")]
public static IWebProxy GetSystemWebProxy()
{
string text = Environment.GetEnvironmentVariable("http_proxy");
if (text == null)
{
text = Environment.GetEnvironmentVariable("HTTP_PROXY");
}
if (text != null)
{
try
{
if (!text.StartsWith("http://"))
{
text = "http://" + text;
}
global::System.Uri uri = new global::System.Uri(text);
IPAddress ipaddress;
if (IPAddress.TryParse(uri.Host, out ipaddress))
{
if (IPAddress.Any.Equals(ipaddress))
{
uri = new global::System.UriBuilder(uri)
{
Host = "127.0.0.1"
}.Uri;
}
else if (IPAddress.IPv6Any.Equals(ipaddress))
{
uri = new global::System.UriBuilder(uri)
{
Host = "[::1]"
}.Uri;
}
}
return new WebProxy(uri);
}
catch (global::System.UriFormatException)
{
}
}
return new WebProxy();
}
/// <summary>Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with the data needed to serialize the target object.</summary>
/// <param name="serializationInfo">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> to populate with data. </param>
/// <param name="streamingContext">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> that specifies the destination for this serialization.</param>
// Token: 0x0600173B RID: 5947 RVA: 0x0004DDF8 File Offset: 0x0004BFF8
protected virtual void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
{
throw WebRequest.GetMustImplement();
}
/// <summary>Registers a <see cref="T:System.Net.WebRequest" /> descendant for the specified URI.</summary>
/// <returns>true if registration is successful; otherwise, false.</returns>
/// <param name="prefix">The complete URI or URI prefix that the <see cref="T:System.Net.WebRequest" /> descendant services. </param>
/// <param name="creator">The create method that the <see cref="T:System.Net.WebRequest" /> calls to create the <see cref="T:System.Net.WebRequest" /> descendant. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="prefix" /> is null-or- <paramref name="creator" /> is null. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// <IPermission class="System.Net.WebPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x0600173C RID: 5948 RVA: 0x0004DE00 File Offset: 0x0004C000
public static bool RegisterPrefix(string prefix, IWebRequestCreate creator)
{
if (prefix == null)
{
throw new ArgumentNullException("prefix");
}
if (creator == null)
{
throw new ArgumentNullException("creator");
}
object syncRoot = WebRequest.prefixes.SyncRoot;
lock (syncRoot)
{
string text = prefix.ToLower(CultureInfo.InvariantCulture);
if (WebRequest.prefixes.Contains(text))
{
return false;
}
WebRequest.prefixes.Add(text, creator);
}
return true;
}
// Token: 0x0600173D RID: 5949 RVA: 0x0004DE9C File Offset: 0x0004C09C
private static IWebRequestCreate GetCreator(string prefix)
{
int num = -1;
IWebRequestCreate webRequestCreate = null;
prefix = prefix.ToLower(CultureInfo.InvariantCulture);
IDictionaryEnumerator enumerator = WebRequest.prefixes.GetEnumerator();
while (enumerator.MoveNext())
{
string text = enumerator.Key as string;
if (text.Length > num)
{
if (prefix.StartsWith(text))
{
num = text.Length;
webRequestCreate = (IWebRequestCreate)enumerator.Value;
}
}
}
if (webRequestCreate == null)
{
throw new NotSupportedException(prefix);
}
return webRequestCreate;
}
// Token: 0x0600173E RID: 5950 RVA: 0x0004DF24 File Offset: 0x0004C124
internal static void ClearPrefixes()
{
WebRequest.prefixes.Clear();
}
// Token: 0x0600173F RID: 5951 RVA: 0x0004DF30 File Offset: 0x0004C130
internal static void RemovePrefix(string prefix)
{
WebRequest.prefixes.Remove(prefix);
}
// Token: 0x06001740 RID: 5952 RVA: 0x0004DF40 File Offset: 0x0004C140
internal static void AddPrefix(string prefix, string typeName)
{
Type type = Type.GetType(typeName);
if (type == null)
{
throw new ArgumentException(string.Format("Type {0} not found", typeName));
}
WebRequest.AddPrefix(prefix, type);
}
// Token: 0x06001741 RID: 5953 RVA: 0x0004DF74 File Offset: 0x0004C174
internal static void AddPrefix(string prefix, Type type)
{
object obj = Activator.CreateInstance(type, true);
WebRequest.prefixes[prefix] = obj;
}
// Token: 0x04001283 RID: 4739
private static global::System.Collections.Specialized.HybridDictionary prefixes = new global::System.Collections.Specialized.HybridDictionary();
// Token: 0x04001284 RID: 4740
private static bool isDefaultWebProxySet;
// Token: 0x04001285 RID: 4741
private static IWebProxy defaultWebProxy;
// Token: 0x04001286 RID: 4742
private global::System.Net.Security.AuthenticationLevel authentication_level = global::System.Net.Security.AuthenticationLevel.MutualAuthRequested;
// Token: 0x04001287 RID: 4743
private static readonly object lockobj = new object();
}
}