Freigeben über


WebClient.GetWebRequest Method

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

Returns a WebRequest object for the specified resource.

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

Syntax

'Declaration
Protected Overridable Function GetWebRequest ( _
    address As Uri _
) As WebRequest
protected virtual WebRequest GetWebRequest(
    Uri address
)

Parameters

  • address
    Type: System.Uri
    A Uri that identifies the resource to request.

Return Value

Type: System.Net.WebRequest
A new WebRequest object for the specified resource.

Remarks

This method copies the existing Headers and method to the newly created WebRequest object.

This method can be called only by classes that inherit from WebClient. It is provided to give inheritors access to the underlying WebRequest object. Derived classes should call the base class implementation of GetWebRequest to ensure the method works as expected.

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.