将http标头添加到WebView WinStore应用程序? [英] adding http headers to WebView WinStore apps ?

查看:48
本文介绍了将http标头添加到WebView WinStore应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我知道我们无法更改webview应用的用户代理。  可惜,因为这正是我需要做的,显然HttpRequests不会在WebView中呈现(我想也许我可以将HttpClient.GetStringAsync()并将其提供给WebView.NavigateToString(),
但是渲染很糟糕,不允许用户交互。)

so, I understand that we can't change the user agent of webview apps.  Pity, because that's exactly what I need to do, and apparently HttpRequests won't render inside a WebView (I thought perhaps I could HttpClient.GetStringAsync() and feed it to WebView.NavigateToString(), but the rendering is awful and doesn't allow for user interaction).

在网页视图中是否有*任何*方式来改变http标头?  我可以重新编写我的应用程序,以便在必要时在不同的标题中查找其元数据。

Is there *any* way to alter an http header in a web view?  I can recode my app to look for its metadata inside a different header, if necessary.

如果没有,是否有替代WebView(实际渲染)的内容将允许我修改用户代理或任何标题?

If not, is there an alternative to WebView (that actually renders) that will allow me to modify the user agent, or any headers at all?

在这里会喜欢一些想法。  如有必要,愿意从C#更改语言。

Would love some ideas here.  Willing to change languages from C# if necessary.

谢谢!

Joseph Cheek

Joseph Cheek

推荐答案

据我所知,webview控件没有这个功能。

欲了解更多信息,你可以检查

http://blogs.msdn.com/b/wsdevsol/archive/2012/10/18/nine-things-you-need-to-know-about-webview.aspx

As far as I know, the webview control does not have this function.
For more information, you can check
http://blogs.msdn.com/b/wsdevsol/archive/2012/10/18/nine-things-you-need-to-know-about-webview.aspx

另一方面,您可以使用HttpClient设置响应标头,然后获取HTML内容以呈现WebView控件。

 

最好的问候,

Jesse

On the other hands, you can use HttpClient to set the response header and then get the HTML contents to render the WebView Control.
 
Best regards,
Jesse


这篇关于将http标头添加到WebView WinStore应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆