Windows Dev Center

Expand Minimize

WebView.NavigateWithHttpRequestMessage method

Navigates the WebView to a URI with a POST request and HTTP headers.

Syntax


public void NavigateWithHttpRequestMessage(
  HttpRequestMessage requestMessage
)

Parameters

requestMessage

Type: HttpRequestMessage

The details of the HTTP request.

Remarks

This method supports only HttpMethod.Post and HttpMethod.Get for the HttpRequestMessage.Method property value.

Warning  If you add additional headers to this request, such as authentication credentials, remember that those headers will also be included with any subsequent child requests. Use caution to prevent accidental disclosure of confidential or personal information.
 

Examples

This example shows how to create an HTTP request and use it with this method.


HttpRequestMessage httpRequestMessage = new HttpRequestMessage(
    HttpMethod.Post, new Uri("http://www.contoso.com"));
httpRequestMessage.Content = new HttpStringContent("hello, world");
httpRequestMessage.Headers.Append("X-My-Client","true");

myWebView.NavigateWithHttpRequestMessage(httpRequestMessage);


Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

WebView

 

 

Show:
© 2015 Microsoft