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
{
/// Makes a request to a Uniform Resource Identifier (URI). This is an abstract class.
// Token: 0x0200026F RID: 623
[Serializable]
public abstract class WebRequest : MarshalByRefObject, ISerializable
{
/// Initializes a new instance of the class.
// Token: 0x0600170A RID: 5898 RVA: 0x0004D9F8 File Offset: 0x0004BBF8
protected WebRequest()
{
}
/// Initializes a new instance of the class from the specified instances of the and classes.
/// A that contains the information required to serialize the new instance.
/// A that indicates the source of the serialized stream associated with the new instance.
/// Any attempt is made to access the constructor, when the constructor is not overridden in a descendant class.
// 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");
}
/// When overridden in a descendant class, populates a instance with the data needed to serialize the .
/// A , which holds the serialized data for the .
/// A that contains the destination of the serialized stream associated with the new .
/// An attempt is made to serialize the object, when the interface is not overridden in a descendant class.
// 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");
}
/// Gets or sets values indicating the level of authentication and impersonation used for this request.
/// A bitwise combination of the values. The default value is .In mutual authentication, both the client and server present credentials to establish their identity. The and 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 property. If you specify the authentication flag value and mutual authentication does not occur, your application will receive an with a inner exception indicating that mutual authentication failed.
// 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;
}
}
/// Gets or sets the cache policy for this request.
/// A object that defines a cache policy.
// 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
{
}
}
/// When overridden in a descendant class, gets or sets the name of the connection group for the request.
/// The name of the connection group for the request.
/// Any attempt is made to get or set the property, when the property is not overridden in a descendant class.
///
///
///
// 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();
}
}
/// When overridden in a descendant class, gets or sets the content length of the request data being sent.
/// The number of bytes of request data being sent.
/// Any attempt is made to get or set the property, when the property is not overridden in a descendant class.
///
///
///
// 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();
}
}
/// When overridden in a descendant class, gets or sets the content type of the request data being sent.
/// The content type of the request data.
/// Any attempt is made to get or set the property, when the property is not overridden in a descendant class.
///
///
///
// 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();
}
}
/// When overridden in a descendant class, gets or sets the network credentials used for authenticating the request with the Internet resource.
/// An containing the authentication credentials associated with the request. The default is null.
/// Any attempt is made to get or set the property, when the property is not overridden in a descendant class.
///
///
///
// 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();
}
}
/// Gets or sets the default cache policy for this request.
/// A that specifies the cache policy in effect for this request when no other policy is applicable.
// 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();
}
}
/// When overridden in a descendant class, gets or sets the collection of header name/value pairs associated with the request.
/// A containing the header name/value pairs associated with this request.
/// Any attempt is made to get or set the property, when the property is not overridden in a descendant class.
///
///
///
// 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();
}
}
/// Gets or sets the impersonation level for the current request.
/// A value.
// 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();
}
}
/// When overridden in a descendant class, gets or sets the protocol method to use in this request.
/// The protocol method to use in this request.
/// If the property is not overridden in a descendant class, any attempt is made to get or set the property.
///
///
///
// 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();
}
}
/// When overridden in a descendant class, indicates whether to pre-authenticate the request.
/// true to pre-authenticate; otherwise, false.
/// Any attempt is made to get or set the property, when the property is not overridden in a descendant class.
///
///
///
// 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();
}
}
/// When overridden in a descendant class, gets or sets the network proxy to use to access this Internet resource.
/// The to use to access the Internet resource.
/// Any attempt is made to get or set the property, when the property is not overridden in a descendant class.
///
///
///
// 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();
}
}
/// When overridden in a descendant class, gets the URI of the Internet resource associated with the request.
/// A representing the resource associated with the request
/// Any attempt is made to get or set the property, when the property is not overridden in a descendant class.
///
///
///
// Token: 0x17000760 RID: 1888
// (get) Token: 0x06001728 RID: 5928 RVA: 0x0004DB88 File Offset: 0x0004BD88
public virtual global::System.Uri RequestUri
{
get
{
throw WebRequest.GetMustImplement();
}
}
/// Gets or sets the length of time, in milliseconds, before the request times out.
/// The length of time, in milliseconds, until the request times out, or the value to indicate that the request does not time out. The default value is defined by the descendant class.
/// Any attempt is made to get or set the property, when the property is not overridden in a descendant class.
///
///
///
// 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();
}
}
/// When overridden in a descendant class, gets or sets a value that controls whether are sent with requests.
/// true if the default credentials are used; otherwise false. The default value is false.
/// You attempted to set this property after the request was sent.
///
///
///
// 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();
}
}
/// Gets or sets the global HTTP proxy.
/// An used by every call to instances of .
// 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;
}
/// Aborts the Request
/// Any attempt is made to access the method, when the method is not overridden in a descendant class.
///
///
///
// Token: 0x06001730 RID: 5936 RVA: 0x0004DC34 File Offset: 0x0004BE34
public virtual void Abort()
{
throw WebRequest.GetMustImplement();
}
/// When overridden in a descendant class, provides an asynchronous version of the method.
/// An that references the asynchronous request.
/// The delegate.
/// An object containing state information for this asynchronous request.
/// Any attempt is made to access the method, when the method is not overridden in a descendant class.
// Token: 0x06001731 RID: 5937 RVA: 0x0004DC3C File Offset: 0x0004BE3C
public virtual IAsyncResult BeginGetRequestStream(AsyncCallback callback, object state)
{
throw WebRequest.GetMustImplement();
}
/// When overridden in a descendant class, begins an asynchronous request for an Internet resource.
/// An that references the asynchronous request.
/// The delegate.
/// An object containing state information for this asynchronous request.
/// Any attempt is made to access the method, when the method is not overridden in a descendant class.
// Token: 0x06001732 RID: 5938 RVA: 0x0004DC44 File Offset: 0x0004BE44
public virtual IAsyncResult BeginGetResponse(AsyncCallback callback, object state)
{
throw WebRequest.GetMustImplement();
}
/// Initializes a new instance for the specified URI scheme.
/// A descendant for the specific URI scheme.
/// The URI that identifies the Internet resource.
/// The request scheme specified in has not been registered.
///
/// is null.
/// The caller does not have permission to connect to the requested URI or a URI that the request is redirected to.
/// The URI specified in is not a valid URI.
///
///
///
///
///
// 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));
}
/// Initializes a new instance for the specified URI scheme.
/// A descendant for the specified URI scheme.
/// A containing the URI of the requested resource.
/// The request scheme specified in is not registered.
///
/// is null.
/// The caller does not have permission to connect to the requested URI or a URI that the request is redirected to.
///
///
///
///
///
// 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);
}
/// Initializes a new instance for the specified URI scheme.
/// A descendant for the specified URI scheme.
/// A containing the URI of the requested resource.
/// The request scheme specified in is not registered.
///
/// is null.
/// The caller does not have permission to connect to the requested URI or a URI that the request is redirected to.
///
///
///
///
///
// 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);
}
/// When overridden in a descendant class, returns a for writing data to the Internet resource.
/// A to write data to.
/// An that references a pending request for a stream.
/// Any attempt is made to access the method, when the method is not overridden in a descendant class.
// Token: 0x06001736 RID: 5942 RVA: 0x0004DCDC File Offset: 0x0004BEDC
public virtual Stream EndGetRequestStream(IAsyncResult asyncResult)
{
throw WebRequest.GetMustImplement();
}
/// When overridden in a descendant class, returns a .
/// A that contains a response to the Internet request.
/// An that references a pending request for a response.
/// Any attempt is made to access the method, when the method is not overridden in a descendant class.
// Token: 0x06001737 RID: 5943 RVA: 0x0004DCE4 File Offset: 0x0004BEE4
public virtual WebResponse EndGetResponse(IAsyncResult asyncResult)
{
throw WebRequest.GetMustImplement();
}
/// When overridden in a descendant class, returns a for writing data to the Internet resource.
/// A for writing data to the Internet resource.
/// Any attempt is made to access the method, when the method is not overridden in a descendant class.
///
///
///
// Token: 0x06001738 RID: 5944 RVA: 0x0004DCEC File Offset: 0x0004BEEC
public virtual Stream GetRequestStream()
{
throw WebRequest.GetMustImplement();
}
/// When overridden in a descendant class, returns a response to an Internet request.
/// A containing the response to the Internet request.
/// Any attempt is made to access the method, when the method is not overridden in a descendant class.
///
///
///
// Token: 0x06001739 RID: 5945 RVA: 0x0004DCF4 File Offset: 0x0004BEF4
public virtual WebResponse GetResponse()
{
throw WebRequest.GetMustImplement();
}
/// Returns a proxy configured with the Internet Explorer settings of the currently impersonated user.
/// An used by every call to instances of .
// 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();
}
/// Populates a with the data needed to serialize the target object.
/// The to populate with data.
/// A that specifies the destination for this serialization.
// Token: 0x0600173B RID: 5947 RVA: 0x0004DDF8 File Offset: 0x0004BFF8
protected virtual void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
{
throw WebRequest.GetMustImplement();
}
/// Registers a descendant for the specified URI.
/// true if registration is successful; otherwise, false.
/// The complete URI or URI prefix that the descendant services.
/// The create method that the calls to create the descendant.
///
/// is null-or- is null.
///
///
///
///
///
// 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();
}
}