Partager via


IWebRequestCreate.Create Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Creates a WebRequest instance.

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

Syntax

'Declaration
Function Create ( _
    uri As Uri _
) As WebRequest
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.

Exceptions

Exception Condition
NotSupportedException

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

ArgumentNullException

uri is nulla null reference (Nothing in Visual Basic).

SecurityException

The caller does not have permission to connect to the requested URI or a URI that the request is redirected to.

UriFormatException

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.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.