flair-systems / flair-api-client-py

Python Client for Flair API
Apache License 2.0
15 stars 5 forks source link

API requests are not made using a Session object #6

Open fcfort opened 2 years ago

fcfort commented 2 years ago

The code is using requests.get directly without creating a session (https://requests.readthedocs.io/en/latest/user/advanced/#session-objects) which results in no HTTP Keep-Alive or connection pooling. This means the API client is creating and tearing down a TCP connection for each request, potentially resulting in worse performance for users of the client. See https://github.com/flair-systems/flair-api-client-py/blob/d928840eab96eb80c9c5069ddf64e6841a0e2f60/flair_api/client.py#L191