mscorlib(4.0.0.0) API with additions
|
Makes a request to a Uniform Resource Identifier (URI). This is an abstract
class.
More...
Public Member Functions | |
virtual Stream | GetRequestStream () |
When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource. More... | |
virtual WebResponse | GetResponse () |
When overridden in a descendant class, returns a response to an Internet request. More... | |
virtual IAsyncResult | BeginGetResponse (AsyncCallback callback, object state) |
When overridden in a descendant class, begins an asynchronous request for an Internet resource. More... | |
virtual WebResponse | EndGetResponse (IAsyncResult asyncResult) |
When overridden in a descendant class, returns a T:System.Net.WebResponse. More... | |
virtual IAsyncResult | BeginGetRequestStream (AsyncCallback callback, object state) |
When overridden in a descendant class, provides an asynchronous version of the M:System.Net.WebRequest.GetRequestStream method. More... | |
virtual Stream | EndGetRequestStream (IAsyncResult asyncResult) |
When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource. More... | |
virtual Task< Stream > | GetRequestStreamAsync () |
When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource as an asynchronous operation. More... | |
virtual Task< WebResponse > | GetResponseAsync () |
When overridden in a descendant class, returns a response to an Internet request as an asynchronous operation. More... | |
virtual void | Abort () |
Aborts the Request More... | |
![]() | |
object | GetLifetimeService () |
Retrieves the current lifetime service object that controls the lifetime policy for this instance. More... | |
virtual object | InitializeLifetimeService () |
Obtains a lifetime service object to control the lifetime policy for this instance. More... | |
virtual ObjRef | CreateObjRef (Type requestedType) |
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. More... | |
Static Public Member Functions | |
static void | RegisterPortableWebRequestCreator (IWebRequestCreate creator) |
Register an T:System.Net.IWebRequestCreate object. More... | |
static WebRequest | Create (string requestUriString) |
Initializes a new T:System.Net.WebRequest instance for the specified URI scheme. More... | |
static WebRequest | Create (Uri requestUri) |
Initializes a new T:System.Net.WebRequest instance for the specified URI scheme. More... | |
static WebRequest | CreateDefault (Uri requestUri) |
Initializes a new T:System.Net.WebRequest instance for the specified URI scheme. More... | |
static HttpWebRequest | CreateHttp (string requestUriString) |
Initializes a new T:System.Net.HttpWebRequest instance for the specified URI string. More... | |
static HttpWebRequest | CreateHttp (Uri requestUri) |
Initializes a new T:System.Net.HttpWebRequest instance for the specified URI. More... | |
static bool | RegisterPrefix (string prefix, IWebRequestCreate creator) |
Registers a T:System.Net.WebRequest descendant for the specified URI. More... | |
static IWebProxy | GetSystemWebProxy () |
Returns a proxy configured with the Internet Explorer settings of the currently impersonated user. More... | |
Protected Member Functions | |
WebRequest () | |
Initializes a new instance of the T:System.Net.WebRequest class. More... | |
WebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext) | |
Initializes a new instance of the T:System.Net.WebRequest class from the specified instances of the T:System.Runtime.Serialization.SerializationInfo and T:System.Runtime.Serialization.StreamingContext classes. More... | |
virtual void | GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext) |
Populates a T:System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object. More... | |
![]() | |
MarshalByRefObject | MemberwiseClone (bool cloneIdentity) |
Creates a shallow copy of the current T:System.MarshalByRefObject object. More... | |
Properties | |
virtual IWebRequestCreate | CreatorInstance [get] |
When overridden in a descendant class, gets the factory object derived from the T:System.Net.IWebRequestCreate class used to create the T:System.Net.WebRequest instantiated for making the request to the specified URI. More... | |
static RequestCachePolicy | DefaultCachePolicy [get, set] |
Gets or sets the default cache policy for this request. More... | |
virtual RequestCachePolicy | CachePolicy [get, set] |
Gets or sets the cache policy for this request. More... | |
virtual string | Method [get, set] |
When overridden in a descendant class, gets or sets the protocol method to use in this request. More... | |
virtual Uri | RequestUri [get] |
When overridden in a descendant class, gets the URI of the Internet resource associated with the request. More... | |
virtual string | ConnectionGroupName [get, set] |
When overridden in a descendant class, gets or sets the name of the connection group for the request. More... | |
virtual WebHeaderCollection | Headers [get, set] |
When overridden in a descendant class, gets or sets the collection of header name/value pairs associated with the request. More... | |
virtual long | ContentLength [get, set] |
When overridden in a descendant class, gets or sets the content length of the request data being sent. More... | |
virtual string | ContentType [get, set] |
When overridden in a descendant class, gets or sets the content type of the request data being sent. More... | |
virtual ICredentials | Credentials [get, set] |
When overridden in a descendant class, gets or sets the network credentials used for authenticating the request with the Internet resource. More... | |
virtual bool | UseDefaultCredentials [get, set] |
When overridden in a descendant class, gets or sets a T:System.Boolean value that controls whether P:System.Net.CredentialCache.DefaultCredentials are sent with requests. More... | |
virtual IWebProxy | Proxy [get, set] |
When overridden in a descendant class, gets or sets the network proxy to use to access this Internet resource. More... | |
virtual bool | PreAuthenticate [get, set] |
When overridden in a descendant class, indicates whether to pre-authenticate the request. More... | |
virtual int | Timeout [get, set] |
Gets or sets the length of time, in milliseconds, before the request times out. More... | |
AuthenticationLevel | AuthenticationLevel [get, set] |
Gets or sets values indicating the level of authentication and impersonation used for this request. More... | |
TokenImpersonationLevel | ImpersonationLevel [get, set] |
Gets or sets the impersonation level for the current request. More... | |
static IWebProxy | DefaultWebProxy [get, set] |
Gets or sets the global HTTP proxy. More... | |
Makes a request to a Uniform Resource Identifier (URI). This is an abstract
class.
Definition at line 21 of file WebRequest.cs.
|
protected |
Initializes a new instance of the T:System.Net.WebRequest class.
Definition at line 673 of file WebRequest.cs.
|
protected |
Initializes a new instance of the T:System.Net.WebRequest class from the specified instances of the T:System.Runtime.Serialization.SerializationInfo and T:System.Runtime.Serialization.StreamingContext classes.
serializationInfo | A T:System.Runtime.Serialization.SerializationInfo that contains the information required to serialize the new T:System.Net.WebRequest instance. |
streamingContext | A T:System.Runtime.Serialization.StreamingContext that indicates the source of the serialized stream associated with the new T:System.Net.WebRequest instance. |
T:System.NotImplementedException | Any attempt is made to access the constructor, when the constructor is not overridden in a descendant class. |
Definition at line 683 of file WebRequest.cs.
|
virtual |
Aborts the Request
T:System.NotImplementedException | Any attempt is made to access the method, when the method is not overridden in a descendant class. |
Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.
Definition at line 854 of file WebRequest.cs.
|
virtual |
When overridden in a descendant class, provides an asynchronous version of the M:System.Net.WebRequest.GetRequestStream method.
callback | The T:System.AsyncCallback delegate. |
state | An object containing state information for this asynchronous request. |
T:System.NotImplementedException | Any attempt is made to access the method, when the method is not overridden in a descendant class. |
Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.
Definition at line 759 of file WebRequest.cs.
|
virtual |
When overridden in a descendant class, begins an asynchronous request for an Internet resource.
callback | The T:System.AsyncCallback delegate. |
state | An object containing state information for this asynchronous request. |
T:System.NotImplementedException | Any attempt is made to access the method, when the method is not overridden in a descendant class. |
Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.
Definition at line 737 of file WebRequest.cs.
|
static |
Initializes a new T:System.Net.WebRequest instance for the specified URI scheme.
requestUriString | The URI that identifies the Internet resource. |
T:System.NotSupportedException | The request scheme specified in requestUriString has not been registered. |
T:System.ArgumentNullException | requestUriString is null . |
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. |
T:System.UriFormatException | In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead.The URI specified in requestUriString is not a valid URI. |
Definition at line 533 of file WebRequest.cs.
|
static |
Initializes a new T:System.Net.WebRequest instance for the specified URI scheme.
requestUri | A T:System.Uri containing the URI of the requested resource. |
T:System.NotSupportedException | The request scheme specified in requestUri is not registered. |
T:System.ArgumentNullException | requestUri is null . |
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. |
Definition at line 550 of file WebRequest.cs.
|
static |
Initializes a new T:System.Net.WebRequest instance for the specified URI scheme.
requestUri | A T:System.Uri containing the URI of the requested resource. |
T:System.NotSupportedException | The request scheme specified in requestUri is not registered. |
T:System.ArgumentNullException | requestUri is null . |
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. |
Definition at line 566 of file WebRequest.cs.
|
static |
Initializes a new T:System.Net.HttpWebRequest instance for the specified URI string.
requestUriString | A URI string that identifies the Internet resource. |
T:System.NotSupportedException | The request scheme specified in requestUriString is the http or https scheme. |
T:System.ArgumentNullException | requestUriString is null . |
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. |
T:System.UriFormatException | The URI specified in requestUriString is not a valid URI. |
Definition at line 584 of file WebRequest.cs.
|
static |
Initializes a new T:System.Net.HttpWebRequest instance for the specified URI.
requestUri | A URI that identifies the Internet resource. |
T:System.NotSupportedException | The request scheme specified in requestUri is the http or https scheme. |
T:System.ArgumentNullException | requestUri is null . |
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. |
T:System.UriFormatException | The URI specified in requestUri is not a valid URI. |
Definition at line 602 of file WebRequest.cs.
|
virtual |
When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource.
asyncResult | An T:System.IAsyncResult that references a pending request for a stream. |
T:System.NotImplementedException | Any attempt is made to access the method, when the method is not overridden in a descendant class. |
Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.
Definition at line 769 of file WebRequest.cs.
|
virtual |
When overridden in a descendant class, returns a T:System.Net.WebResponse.
asyncResult | An T:System.IAsyncResult that references a pending request for a response. |
T:System.NotImplementedException | Any attempt is made to access the method, when the method is not overridden in a descendant class. |
Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.
Definition at line 747 of file WebRequest.cs.
|
protectedvirtual |
Populates a T:System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
serializationInfo | The T:System.Runtime.Serialization.SerializationInfo to populate with data. |
streamingContext | A T:System.Runtime.Serialization.StreamingContext that specifies the destination for this serialization. |
Implements System.Runtime.Serialization.ISerializable.
Reimplemented in System.Net.HttpWebRequest, and System.Net.FileWebRequest.
Definition at line 701 of file WebRequest.cs.
|
virtual |
When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource.
T:System.NotImplementedException | Any attempt is made to access the method, when the method is not overridden in a descendant class. |
Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.
Definition at line 717 of file WebRequest.cs.
When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource as an asynchronous operation.
Definition at line 778 of file WebRequest.cs.
|
virtual |
When overridden in a descendant class, returns a response to an Internet request.
T:System.NotImplementedException | Any attempt is made to access the method, when the method is not overridden in a descendant class. |
Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.
Definition at line 725 of file WebRequest.cs.
|
virtual |
When overridden in a descendant class, returns a response to an Internet request as an asynchronous operation.
Definition at line 813 of file WebRequest.cs.
|
static |
Returns a proxy configured with the Internet Explorer settings of the currently impersonated user.
Definition at line 881 of file WebRequest.cs.
|
static |
Register an T:System.Net.IWebRequestCreate object.
creator | The T:System.Net.IWebRequestCreate object to register. |
Definition at line 482 of file WebRequest.cs.
|
static |
Registers a T:System.Net.WebRequest descendant for the specified URI.
prefix | The complete URI or URI prefix that the T:System.Net.WebRequest descendant services. |
creator | The create method that the T:System.Net.WebRequest calls to create the T:System.Net.WebRequest descendant. |
true
if registration is successful; otherwise, false
.T:System.ArgumentNullException | prefix is null -or- creator is null . |
Definition at line 624 of file WebRequest.cs.
|
getset |
Gets or sets values indicating the level of authentication and impersonation used for this request.
Definition at line 396 of file WebRequest.cs.
|
getset |
Gets or sets the cache policy for this request.
Definition at line 186 of file WebRequest.cs.
|
getset |
When overridden in a descendant class, gets or sets the name of the connection group for the request.
T:System.NotImplementedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
Definition at line 232 of file WebRequest.cs.
|
getset |
When overridden in a descendant class, gets or sets the content length of the request data being sent.
T:System.NotImplementedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
Definition at line 265 of file WebRequest.cs.
|
getset |
When overridden in a descendant class, gets or sets the content type of the request data being sent.
T:System.NotImplementedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
Definition at line 281 of file WebRequest.cs.
|
get |
When overridden in a descendant class, gets the factory object derived from the T:System.Net.IWebRequestCreate class used to create the T:System.Net.WebRequest instantiated for making the request to the specified URI.
Definition at line 123 of file WebRequest.cs.
|
getset |
When overridden in a descendant class, gets or sets the network credentials used for authenticating the request with the Internet resource.
null
.T:System.NotImplementedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
Definition at line 299 of file WebRequest.cs.
|
staticgetset |
Gets or sets the default cache policy for this request.
Definition at line 170 of file WebRequest.cs.
|
staticgetset |
Gets or sets the global HTTP proxy.
Definition at line 463 of file WebRequest.cs.
|
getset |
When overridden in a descendant class, gets or sets the collection of header name/value pairs associated with the request.
T:System.NotImplementedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
Definition at line 248 of file WebRequest.cs.
|
getset |
Gets or sets the impersonation level for the current request.
Definition at line 410 of file WebRequest.cs.
|
getset |
When overridden in a descendant class, gets or sets the protocol method to use in this request.
T:System.NotImplementedException | If the property is not overridden in a descendant class, any attempt is made to get or set the property. |
Definition at line 202 of file WebRequest.cs.
|
getset |
When overridden in a descendant class, indicates whether to pre-authenticate the request.
true
to pre-authenticate; otherwise, false
.T:System.NotImplementedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
Definition at line 355 of file WebRequest.cs.
|
getset |
When overridden in a descendant class, gets or sets the network proxy to use to access this Internet resource.
T:System.NotImplementedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
Definition at line 337 of file WebRequest.cs.
|
get |
When overridden in a descendant class, gets the URI of the Internet resource associated with the request.
T:System.NotImplementedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
Definition at line 220 of file WebRequest.cs.
|
getset |
Gets or sets the length of time, in milliseconds, before the request times out.
T:System.NotImplementedException | Any attempt is made to get or set the property, when the property is not overridden in a descendant class. |
Definition at line 370 of file WebRequest.cs.
|
getset |
When overridden in a descendant class, gets or sets a T:System.Boolean value that controls whether P:System.Net.CredentialCache.DefaultCredentials are sent with requests.
true
if the default credentials are used; otherwise false
. The default value is false
.T:System.InvalidOperationException | You attempted to set this property after the request was sent. |
T:System.NotImplementedException | Any attempt is made to access the property, when the property is not overridden in a descendant class. |
Definition at line 319 of file WebRequest.cs.