Constructs a new instance of a class derived from System.Net.WebRequest. The new instance is of the type registered for the scheme of the specified URI.
- requestUriString
- A string that contains a URI.
A new instance of a class that derived from System.Net.WebRequest and is registered to handle the scheme of requestUriString.
Type Reason !:System.Security.Permissions.WebPermission Requires permission to connect to the requested URI. See NetworkAccess.Connect.
Type Reason ArgumentNullException requestUriString is null. NotSupportedException The request scheme specified in requestUri is not registered. UriFormatException The URI specified in requestUriString is not a valid URI. System.Security.SecurityException The caller does not have permission to connect to the requested URI or a URI that the request is redirected to.
Note:This method returns a new instance of a class that derived from System.Net.WebRequest . The Type of this new instance is determined at run time by the scheme of the URI in requestUriString. For example, when a URI beginning with http:// is passed in requestUriString, a System.Net.HttpWebRequest instance is returned.
Classes that derive from System.Net.WebRequest that are created to handle other requests are registered with the WebRequest.RegisterPrefix(string, IWebRequestCreate) method.
Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0