Configuring UserAgent for HttpWebRequest in Silverlight 4

I am using Silverlight 4 and must install (override) UserAgentfor HttpWebRequest. Unfortunately, this is not supported. Platform Notes on MSDN :

"Do not use this item when configuring on Silverlight 4."

And if I try, I get System.NotImplementedExceptionusing this StackTrace: in System.Net.Browser.ClientHttpWebRequest.SetUserAgent (string value) in System.Net.HttpWebRequest.set_UserAgent (string value)

I tried to directly modify the collection Headers, but it returns the same error.

Is there any way to do this?

Bonus question: does anyone know why this is not supported?

+3
source share

Source: https://habr.com/ru/post/1794106/


All Articles