使用POST参数启动webview

时间:2014-12-10 16:32:57

标签: c# windows-phone windows-store-apps win-universal-app

我想导航到带有远程URI的webview,这需要POST参数来显示正确的数据。

有没有人在Windows Phone 8.1 Universal Apps中意识到这一点?

目前,我成功检索了一个httpResponse:

string url = "https://v3.goomeoevents.fr/webview/networking/msge";
uri UriToNavigate = new Uri(url, UriKind.Absolute);
var client = new HttpClient();
HttpRequestMessage requestMessage = null;
HttpResponseMessage httpResponse = null;
HttpMethod methodPOST = HttpMethod.Post;
List<KeyValuePair<string, string>> postData = new List<KeyValuePair<string, string>>();
requestMessage = new HttpRequestMessage(methodPOST, UriToNavigate);

postData.Add(new KeyValuePair<string, string>("lang","fr-FR");
requestMessage.Content = new HugeFormUrlEncodedContent(postData);
content = new FormUrlEncodedContent(postData);

httpResponse = await client.SendAsync(requestMessage);

0 个答案:

没有答案