Create Method
Collapse the table of content
Expand the table of content

IWebRequestCreate.Create Method (Uri)


Creates a WebRequest instance.

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

WebRequest Create(
	Uri uri


Type: System.Uri

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

Return Value

Type: System.Net.WebRequest

A WebRequest instance.

Exception Condition

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 , 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 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft