, ...
var response = owin.HttpClient.PostAsJsonAsync(uri, body);
var result = response.Wait(15000);
var itemPreview = response.Result.Content.ReadAsAsync<ItemPreview>();
...
, 15 . , , A.K.A, . (n) false.
ReadAsAsync...
var response = owin.HttpClient.PostAsJsonAsync(uri, body);
var itemPreview = response.Result.Content.ReadAsAsync<ItemPreview>();
, , , . (n) , true, ReadAsAsync() . - , HttpClient, ReadAsAsync AggregateException InnerException TaskCanceledException.
, owin.HttpClient, HttpClient. , owin, , WebApi, , . , Add (Item item) WebApi db.AddItem(item) ItemPreview, :
[TestMethod]
public void test1()
{
Item item = new(...);
var uri = "..";
var client = new HttpClient();
var response = client.PostAsJsonAsync(uri, item);
var itemPreview = response.Result.Content.ReadAsAsync<ItemPreview>();
}