What is the correct way to share an HttpClient across function invocations?
- A Create a new HttpClient per invocation
- B Use a static/singleton HttpClient or IHttpClientFactory (correct answer)
- C Use a using block per call
- D Store it in the function context
Shortcut: Creating a client per invocation exhausts sockets under load. A static instance or IHttpClientFactory reuses connections correctly across invocations on the same instance.