Fiddler также работает с приведенными ниже деталями в compose
GET https://api.census.gov/data/2014/pep/natstprc?get=STNAME,POP&DATE_=7&for=state:*
Host: api.census.gov
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cookie: s_fid=1D2530B98DEBC491-3E8622C8107ED858
Вот мой код, который я пытаюсь, но возвращаю 403
_httpClient.BaseAddress = new Uri("https://api.census.gov/data/2014/pep/natstprc");
_httpClient.Timeout = new TimeSpan(0, 0, 30);
_httpClient.DefaultRequestHeaders.Host = "api.census.gov";
_httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xhtml+xml"));
_httpClient.DefaultRequestHeaders.Add("User-Agent", "Chrome");
_httpClient.DefaultRequestHeaders.Add("Accept-Language", "en-US,en");
_httpClient.DefaultRequestHeaders.Add("Accept-Encoding", "gzip,deflate,br");
_httpClient.DefaultRequestHeaders.Add("Sec-Fetch-Dest", "document");
_httpClient.DefaultRequestHeaders.Add("Sec-Fetch-Mode", "navigate");
_httpClient.DefaultRequestHeaders.Add("Sec-Fetch-Site", "none");
_httpClient.DefaultRequestHeaders.Add("Sec-Fetch-User", "?1");
var res = _httpClient.GetAsync(_httpClient.BaseAddress).Result;