Create Method (String)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Initializes a new WebRequest instance for the specified URI scheme.
Namespace: System.Net
Assembly: System.Http (in System.Http.dll)
Syntax
'Declaration
Public Shared Function Create ( _
requestUriString As String _
) As WebRequest
public static WebRequest Create(
string requestUriString
)
public:
static WebRequest^ Create(
String^ requestUriString
)
static member Create :
requestUriString:string -> WebRequest
public static function Create(
requestUriString : String
) : WebRequest
Parameters
- requestUriString
Type: System. . :: . .String
The URI that identifies the Internet resource.
Return Value
Type: System.Net. . :: . .WebRequest
A WebRequest descendant for the specific URI scheme.
Remarks
The Create method returns a descendant of the WebRequest class determined at run time as the closest registered match for requestUri.
For example, when a URI beginning with http:// or https:// is passed in requestUri, an HttpWebRequest is returned by Create. If a URI beginning with ftp:// is passed instead, the Create method will return a FileWebRequest instance. If a URI beginning with file:// is passed instead, the Create method will return a FileWebRequest instance.
The pre-registered reserve types already registered include the following:
http://
https://
ftp://
file://
The Create method uses the requestUriString parameter to create a Uri instance that it passes to the new WebRequest.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.