System.Net.WebClient.GetWebRequest Method

Returns a System.Net.WebRequest object for the specified resource.

Syntax

protected virtual WebRequest GetWebRequest (Uri address)

Parameters

address
A Uri that identifies the resource to request.

Returns

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

Remarks

This method copies the existing WebClient.Headers, WebClient.Credentials, and method to the newly created System.Net.WebRequest object.

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

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0