C# Add Accept header to HttpClient
There is no difference. DefaultRequestHeaders.Accept is a collection of string type, where you can add your header to accept using the new instance of MediaTypeWithQualityHeaderValue. client.DefaultRequestHeaders is a dictionary that accepts key for and value for the request header and matches the results according to them. DefaultRequestHeaders has overloads. The only thing that differs between … Read more