I only added Auththe authentication header to it and thisit worked for me AuthToken. AuthToken is either a string variable or the token itself I. I left out Thethe content type header and it just works, below. Below is the code Responsecode; Response is a string that has to be serialized to a JobjectJobject.
{ String Response = null; HttpClient client = new HttpClient(CertByPass()); client.Timeout = TimeSpan.FromMinutes(5); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(AuthToken); Response = await client.GetStringAsync(url); } { String Response = null; HttpClient client = new HttpClient(CertByPass()); client.Timeout = TimeSpan.FromMinutes(5); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(AuthToken); Response = await client.GetStringAsync(url); }