I\'m trying to set the Content-Type header of an HttpClient object as required by an API I am calling.
Content-Type
HttpClient
I tried setting the Content-Ty
Content-Ty
Ok, it's not HTTPClient but if u can use it, WebClient is quite easy:
using (var client = new System.Net.WebClient()) { client.Headers.Add("Accept", "application/json"); client.Headers.Add("Content-Type", "application/json; charset=utf-8"); client.DownloadString(...); }