6 ms·
HttpClient is thread-safe. The above use case, while not ideal, will work perfectly fine in 95% of situations. (Of course, the "right" way to use HttpClient is
by neonsunset 3y ago
HttpClient is thread-safe. The above use case, while not ideal, will work perfectly fine in 95% of situations.
(Of course, the "right" way to use HttpClient is to have it be injected via DI or retrieved from IHttpClientFactory, but if all you are doing is writing a script-like CLI utility, there is no advantage to that)