Makes a request to a Uniform Resource Identifier (URI). This is an abstract class.
Assembly: System.Net (in System.Net.dll)
Thetype exposes the following members.
|ContentLength||When overridden in a descendant class, gets or sets the content length of the request data being sent.|
|ContentType||When overridden in a descendant class, gets or sets the content type of the request data being sent.|
|CreatorInstance||When overridden in a descendant class, gets the factory object derived from the IWebRequestCreate class used to create the instantiated for making the request to the specified URI.|
|Credentials||When overridden in a descendant class, gets or sets the network credentials used for authenticating the request with the Internet resource.|
|Headers||When overridden in a descendant class, gets or sets the collection of header name/value pairs associated with the request.|
|Method||When overridden in a descendant class, gets or sets the protocol method to use in this request.|
|RequestUri||When overridden in a descendant class, gets the URI of the Internet resource associated with the request.|
|UseDefaultCredentials||When overridden in a descendant class, gets or sets a Boolean value that controls whether default credentials are sent with requests.|
|Abort||Aborts the Request.|
|BeginGetRequestStream||When overridden in a descendant class, provides an asynchronous method to request a stream.|
|BeginGetResponse||When overridden in a descendant class, begins an asynchronous request for an Internet resource.|
|Create(String)||Initializes a new instance for the specified URI scheme.|
|Create(Uri)||Initializes a new instance for the specified URI scheme.|
|CreateHttp(String)||Initializes a new HttpWebRequest instance for the specified URI string.|
|CreateHttp(Uri)||Initializes a new HttpWebRequest instance for the specified URI.|
|EndGetRequestStream||When overridden in a descendant class, returns a Stream for writing data to the Internet resource.|
|EndGetResponse||When overridden in a descendant class, returns a WebResponse.|
|Equals(Object)||Determines whether the specified Object is equal to the current Object. (Inherited from Object.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|RegisterPrefix||Registers a descendant for the specified URI.|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
is the abstract base class for the .NET Framework's request/response model for accessing data from the Internet. An application that uses the request/response model can request data from the Internet in a protocol-agnostic manner, in which the application works with instances of the class while protocol-specific descendant classes carry out the details of the request.
Requests are sent from an application to a particular URI, such as a Web page on a server. The URI determines the proper descendant class to create from a list of descendants registered for the application. descendants are typically registered to handle a specific protocol, such as HTTP or HTTPS, but can be registered to handle a request to a specific server or path on a server.
When Status is UnknownError, additional details about the protocol specific response error may be available using the Response property. If the Response property is not null, this indicates that the remote server responded with an error code. In this case, the Response property can be queried for more specific information about the response.
Because the class is an abstract class, the actual behavior of a instance at run time is determined by the descendant class returned by Create method. For more information about default values and exceptions, see the documentation for the descendant classes, such as HttpWebRequest.
Use the Create method to initialize new instances. Do not use the constructor.
When you inherit from , you must override the following members: Method, RequestUri, Headers, ContentType, Credentials, Abort, BeginGetRequestStream, EndGetRequestStream, BeginGetResponse, and EndGetResponse. In addition, you must provide an implementation of the IWebRequestCreate interface, which defines the Create method used when you call Create. You must register the class that implements the IWebRequestCreate interface, using the RegisterPrefix method.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.