Custom User Agent for HttpClient?

c#, dotnet-httpclient

Solution

Here you go

var client = new HttpClient();
client.DefaultRequestHeaders.Add("User-Agent",
                                 "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; 
                                  WOW64; Trident/6.0)");

Problem

can I set a custom User Agent for a `HttpClient`? I need to view websites in their mobile form.

Original source