Rank: Newbie Groups: Member
Joined: 5/12/2017 Posts: 2
|
Hi
Is it possible to inject headers in a call to WebView.LoadHtml, we have some dynamic content that is built with reference to a site that requires an Authorization header.
When the page is static on the site and we call WebView.LoadRequest with the correct headers in the Request everything works fine. But since there isn't something similar with LoadHtml Method i was wondering if there is an alternative to inject the Header to the call.
Thanks a bunch
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
You won't be able to do that with LoadHtml. The headers are HTTP headers and they are carried by the HTTP protocol layer through a HTTP response. There is no HTTP request/response at all when you use LoadHtml, hence there is no headers.
If you are talking about the dependency resources referenced by the HTML loaded through LoadHtml, then you can handle the WebView's BeforeRequestLoad event and add header entries there through e.Request.Headers property.
Thanks!
|