This is wrong:
new HttpClient();
✅ Correct
builder.Services.AddHttpClient();
Why
-
Reuses sockets
-
Prevents random timeouts
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
This is wrong:
new HttpClient();
✅ Correct
builder.Services.AddHttpClient();
Why
Reuses sockets
Prevents random timeouts