IWebRequestCreate.Create(Uri) Method

Definition

Creates a WebRequest instance.

public:
 System::Net::WebRequest ^ Create(Uri ^ uri);
public System.Net.WebRequest Create (Uri uri);
abstract member Create : Uri -> System.Net.WebRequest
Public Function Create (uri As Uri) As WebRequest

Parameters

uri
Uri

The uniform resource identifier (URI) of the Web resource.

Returns

A WebRequest instance.

Exceptions

The request scheme specified in uri is not supported by this IWebRequestCreate instance.

uri is null.

The URI specified in uri is not a valid URI.

Note: In .NET for Windows Store apps or the Portable Class Library, catch the base class exception, FormatException, instead.

Remarks

The Create method must return an initialized instance of the WebRequest descendant that is capable of performing a standard request/response transaction for the protocol without needing any protocol-specific fields modified.

Applies to