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

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.

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

The URI specified in uri is not a valid URI.

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