Constructs a new instance of a class derived from System.Net.WebRequest.
- requestUri
- A Uri containing the URI of the requested resource.
A new instance of a class derived from System.Net.WebRequest that is registered to handle the closest registered match for requestUri.
Type Reason !:System.Security.Permissions.WebPermission Requires permission to connect to the requested URI. See NetworkAccess.Connect.
Type Reason ArgumentNullException requestUri is null. NotSupportedException The request scheme specified in requestUri is not registered. System.Security.SecurityException The caller does not have permission to connect to the requested URI or a URI that the request is redirected to.
To determine the closest match, this method checks the registered URIs for the longest URI prefix that matches requestUri.
Note:For an example that demonstrates this method, see WebRequest.CreateDefault(Uri).
Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0