Home > Net > Webapi HttpClient send a POST request, external interface interface short calculation time can retur
Webapi HttpClient send a POST request, external interface interface short calculation time can retur
Time:11-22
Using (var httpClient=new httpClient ()) { HttpClient. Timeout=new TimeSpan (24, 0, 0);//set the timeout
Var url=new Uri (" http://localhost:18081/model/cal ");
Var response=httpClient. PostAsJsonAsync (url, InputModel). The Result;//jars interface if the computation time is long, there is no return, stuck in this??? Var data=(https://bbs.csdn.net/topics/response.Content.ReadAsStringAsync). The Result; } ======== Var response=httpClient. PostAsJsonAsync (url, dispatchInput). The Result Send a POST request, external interface interface short calculation time can return, long calculation has not been returned, the same synchronous and asynchronous External interface is jars, figured out the console is output, but the httpClient. PostAsJsonAsync (url, dispatchInput). The Result has been not return, Interface short calculation time, can return, what happened? Thank you very much!