Mono Class Library: System.Net.WebRequest Overview | Members

System.Net.WebRequest.Create Method

Constructs a new instance of a class derived from System.Net.WebRequest. [Edit]

public static WebRequest Create (Uri requestUri)

Parameters

requestUri
A Uri containing the URI of the requested resource. [Edit]

Returns

A new instance of a class derived from System.Net.WebRequest that is registered to handle the closest registered match for requestUri. [Edit]

Permissions

TypeReason
!:System.Security.Permissions.WebPermission [Edit] Requires permission to connect to the requested URI. See NetworkAccess.Connect.

Exceptions

TypeReason
ArgumentNullExceptionrequestUri is null. [Edit]
NotSupportedExceptionThe request scheme specified in requestUri is not registered. [Edit]
System.Security.SecurityExceptionThe caller does not have permission to connect to the requested URI or a URI that the request is redirected to. [Edit]

Remarks

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).

[Edit]

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0