HttpClient httpClient = new HttpClient();
var objAnonymous = new {
prop1 = "prop1",
prop2 = "prop2",
prop3 = "prop3",
prop4 = "prop4",
prop5 = "prop5"
};
var objString = JsonConvert.SerializeObject(objAnonymous);
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "token");
var content = new StringContent(objString, Encoding.UTF8, "application/json");
var response = await httpClient.PostAsync("url", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
HttpClient httpClient = new HttpClient();
var objAnonymous = new {
prop1 = "prop1",
prop2 = "prop2",
prop3 = "prop3",
prop4 = "prop4",
prop5 = "prop5"
};
var objString = JsonConvert.SerializeObject(objAnonymous);
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "token");
var content = new StringContent(objString, Encoding.UTF8, "application/json");
var response = await httpClient.PostAsync("url", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();