The textual representation of the response is hidden in the Content property of the HttpResponseMessage class. In particular, you will receive an answer as follows:
response.Content.ReadAsStringAsync();
Like all modern Async methods, ReadAsStringAsync returns a Task . To get the result directly, use the Result property of the task:
response.Content.ReadAsStringAsync().Result;
Please note that Result blocked. You can also await ReadAsStringAsync() .
Bart van nierop
source share