Initializes a new System.Net.HttpWebRequest instance for the specified URI.
![]()
Returns System.Net.HttpWebRequest.
An System.Net.HttpWebRequest instance for the specific URI string.
The WebRequest.CreateHttp(Uri) method returns an instance of the System.Net.HttpWebRequest class for the requestUri.
When a URI that begins with http:// or http:// is passed in the requestUri parameter, an System.Net.HttpWebRequest is returned by WebRequest.CreateHttp(Uri). Another other scheme will throw a NotSupportedException.
The WebRequest.CreateHttp(Uri) method uses the requestUri parameter to create a new System.Net.HttpWebRequest instance. If the method is successful, the HttpWebRequest.AllowReadStreamBuffering property on the returned System.Net.HttpWebRequest instance is set to false.
The .NET Framework includes support for the http:// and https:// URI schemes. Custom System.Net.WebRequest descendants to handle other requests are registered with the WebRequest.RegisterPrefix(string, IWebRequestCreate) method. The WebRequest.Create(Uri) method can be used to create a descendant of the System.Net.WebRequest class for other schemes.