Shefali Lahariya

Shefali Lahariya

  • NA
  • 257
  • 156.3k

unsupported media type using GET method in httpclient c#

Dec 15 2017 3:07 PM
using code
 
 
string url = "http://localhost:8080/XYZ/API/JCR/ShowAllGroups" + "/" + jioMeetConstant.Uid + "/" + jioMeetConstant.KEY;
var client = new System.Net.Http.HttpClient();
///Adding OAuth token
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", jioMeetConstant.Accesstoken);
HttpResponseMessage aResp = await client.GetAsync(url);
 

Answers (6)