Xero-NetStandard
Xero-NetStandard copied to clipboard
Use static HttpClient to avoid resource exhaustion
Using non-static http client causes every API instance to consume a new TCP connection. This can quickly exhaust server bandwidth and cause crashes and hangs. More on this here: https://www.aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/
https://github.com/XeroAPI/Xero-NetStandard/blob/b7bc7f2f1dd896db6ef25a73c508f3f561a30ff7/Xero.NetStandard.OAuth2Client/src/Client/XeroClient.cs#L19
@JRising-Xero is there any reason this hasn't been addressed? Using a non-static HttpClient is bad practice and making this change would be pretty simple. Happy to do a PR if that's preferred?