IWebRequestCreate.Create Method (Uri)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Creates a WebRequest instance.

Namespace:   System.Net
Assembly:  System (in System.dll)

WebRequest Create(
	Uri uri
)

Parameters

uri
Type: System.Uri

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

Return Value

Type: System.Net.WebRequest

A WebRequest instance.

Exception Condition
NotSupportedException

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

ArgumentNullException

uri is null.

UriFormatException
System_CAPS_noteNote

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.

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.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: