Welcome Guest Search | Active Topics | Sign In | Register

Injecting Headers to a WebView.LoadHtml Call Options
Dino
Posted: Monday, May 15, 2017 4:31:08 PM
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

eo_support
Posted: Monday, May 15, 2017 6:20:01 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.