I have tried it in console application
public async Task<string> Getsmth(string a, string b, string c, HttpClient client)
{
string str = "call to node.js"
var response = await client.GetStringAsync(str);
return response;
}
calling it in console application worked greatly, but after calling same code in web api it got stuck in await line
[Route("api/Getsmth/{a}/{b}/{c}")]
public string Get(string a, string b, string c)
{
HttpClient client = new HttpClient();
var r = Getsmth(a, b, c, client);
return r.Result;
}
after calling it synchronously (without async/await) everything works fine. what seems to be the problem?! How to make it work asynchronously?