WebRequestCreator.ClientHttp Property

July 28, 2014

Gets an object that specifies client HTTP handling for Web requests and responses.

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

public static IWebRequestCreate ClientHttp { get; }

Property Value

Type: System.Net.IWebRequestCreate
An IWebRequestCreate object for use with Windows Phone-based application.

Since the Windows Phone client provides HTTP handling by default, you typically never need to use this property.

The following example shows you how to specify client HTTP handling for all messages.


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);
}


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft