I have a web application that pulls data from an API using the HttpClient class. I have a few questions.
- Is HttpClient optimal for getting data from API? I get a string from APi and deserialize it into an object.
- A new instance of HttpClient is created each time it is used (for each user). Is it best to use:
using (HttpClient client = new HttpClient())
for each request?
Try to find best and optimal solution.