News
All you need is this code (and, yes, I realize that the method's name doesn't do a good job of reflecting what it does): services.AddHttpClient(); Then, in the constructor for any controller that ...
However, if you use HttpClient as it was intended (asynchronously), then the code gets simpler. If I use await and async, as shown in Listing 4, the code isn’t quite as short as with the WebClient … ...
Results that may be inaccessible to you are currently showing.
Hide inaccessible results