6
Reply

unsupported media type using GET method in httpclient c#

Shefali Lahariya

Shefali Lahariya

Dec 15 2017 3:07 PM
218
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)