WP7 WebBrowser Control Headers

HI, can I add request headers in a WP7 WebBrowser control?

+3
source share
3 answers

There is no way to do this. If you need to change the headers you need to use HttpWebRequest.

You can intercept requests from the WebBrowser control and make them yourself through the HWR, but this can be very complicated.

0
source

No - I do not think there is an API for this.

Is this a similar problem with the "change user agent" request discussed in the Revert mobile website version in WebBrowser control for wp7?

0
source

, , . WebBrowser .

WebBrowser.Navigate(YourURI, null, YourCustomHeaderString)

: http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff626636(v=vs.105).aspx

.

, . , , -, WebBrowser:

private void browser_Navigating(object sender, NavigatingEventArgs e)
{
   string url = e.Uri.ToString();

   if(!url.Contains("YESHEADERS"))
   {
       e.Cancel = true;

       string newUrl;
       if(url.Contains("?"))
       {
           newUrl = url + "&YESHEADERS";
       }
       else
       {
           newUrl = url + "?YESHEADERS";
       }

       browser.Navigate(newUrl, null, "fore:" + Variables.GetForeground() + "")
   }
}

:

YESHEADERS, , .

- , , URL-, , e.Uri, YESHEADERS.

, .

, . URL-, URL- . YESHEADERS URL- . , , , URL-, .

URL- .

, YESHEADERS, - , , YESHEADERS, - .

0

All Articles