WebRequestCreator.ClientHttp Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets an object that specifies client HTTP handling for Web requests and responses.
Namespace: System.Net.Browser
Assembly: System.Windows (in System.Windows.dll)
Syntax
Public Shared ReadOnly Property ClientHttp As IWebRequestCreate
public static IWebRequestCreate ClientHttp { get; }
Property Value
Type: System.Net..::.IWebRequestCreate
An IWebRequestCreate object for use with Windows Phone-based application.
Remarks
Since the Windows Phone client provides HTTP handling by default, you typically never need to use this property.
Examples
The following example shows you how to specify client HTTP handling for all messages.
Dim httpResult As Boolean = WebRequest.RegisterPrefix("http://", _
WebRequestCreator.ClientHttp)
Dim httpsResult As Boolean = WebRequest.RegisterPrefix("https://", _
WebRequestCreator.ClientHttp)
...
If httpResult = True Then
Dim wc As New WebClient()
wc.OpenReadAsync(New Uri( _
"http://api.search.live.net/qson.aspx?query=Windows"))
AddHandler wc.OpenReadCompleted, AddressOf wc_OpenReadCompleted
bool httpResult = WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);
bool httpsResult = WebRequest.RegisterPrefix("https://", WebRequestCreator.ClientHttp);
...
if (httpResult == true)
{
WebClient wc = new WebClient();
wc.OpenReadAsync(new Uri("http://api.search.live.net/qson.aspx?query=Windows"));
wc.OpenReadCompleted += new OpenReadCompletedEventHandler(wc_OpenReadCompleted);
}
Version Information
Windows Phone OS
Supported in: 8.1, 8.0, 7.1, 7.0
Platforms
Windows Phone
See Also
Reference
ClientHttp