I am new to HttpClient. My code below always says "WaitingForActivation" in status. Please, help
private static async Task<HttpResponseMessage> MakeCall() { var httpclient = new HttpClient(); var response = await httpclient.GetAsync("http://localhost:60565/Subscribers"); return response; }
Alternatively, if your environment is synchronous, add .Result , for example:
.Result
GetAsync("http://localhost:60565/Subscribers").Result;
This is normal. Just await returned task (asynchronously) until it finishes.
await
You can find a useful intro to async .
async
Source: https://habr.com/ru/post/1500880/More articles:writeToFile does not work with NSDictionary - iosRepresentation of individual bits in C - cWinRT XAML TextBox Remote Performance - windows-runtimeObjective-C: Various ways to declare private variables. Any differences between the two? - objective-chttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1500879/adding-barewords-to-lua&usg=ALkJrhimrFHs_4lhgeEEB2S-y5B1t92jygPHP SoapClient "deserialize error" when passing array to array in property - soapCalling both the base constructor and the constructor without parameters? - inheritanceCasting a NodeList into an array. in javascript - javascriptArrays versus lists for memory problems - arraysDoes the JVM free all resources that the programmer does not explicitly close when exiting the program - javaAll Articles