Hi I\'m trying to set User Agent with WebRequest, but unfortunately I\'ve only found how to do it using HttpWebRequest, so here is my code and I hope you can help me to set
Use the UserAgent property on HttpWebRequest by casting it to a HttpWebRequest.
HttpWebRequest
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.UserAgent = "my user agent";
Alternatively, instead of casting you can use WebRequest.CreateHttp instead.