Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API requests are not made using a Session object #6

Open
fcfort opened this issue Jun 22, 2022 · 0 comments
Open

API requests are not made using a Session object #6

fcfort opened this issue Jun 22, 2022 · 0 comments

Comments

@fcfort
Copy link

fcfort commented Jun 22, 2022

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

resp = requests.get(

RobertD502 added a commit to RobertD502/flair-api-client-py that referenced this issue Jun 22, 2022
Utilize a requests `Session` object in the `Client` class to reuse TCP connection to Flair's servers instead of establishing a new connection for every request.

Fixes flair-systems#6
RobertD502 added a commit to RobertD502/flair-api-client-py that referenced this issue Jun 22, 2022
Utilize a requests `Session` object in the `Client` class to reuse TCP connection to Flair's servers instead of creating a new connection for every request.

Fixes flair-systems#6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant