Get response from PostAsJsonAsync

var httpClient = new HttpClient()

var task = httpClient.PostAsJsonAsync(posturi, model)
	.ContinueWith( x => x.Result.Content.ReadAsAsync<bool>().Result);

// 1. GETTING RESPONSE - NOT ASYNC WAY
task.Wait(); //THIS WILL HOLD THE THREAD AND IT WON'T BE ASYNC ANYMORE!
bool response = task.Result

// 2. GETTING RESPONSE - TASK ASYNC WAY (usually used in < .NET 4.5 
task.ContinueWith( x => {
	bool response = x.Result
});

// 3. GETTING RESPONSE - TASK ASYNC WAY (usually used in >= .NET 4.5 
bool response = await task;

Версия #1
Вербовик М. А. создал 9 July 2021 16:59:43
Вербовик М. А. обновил 9 July 2021 17:00:52