You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this code, we use the with statement to create a Session object for each function. This allows us to reuse the underlying TCP connection between requests, which can reduce the overhead associated with establishing a new connection for each request. We also updated the requests.get() calls to use session.get() instead.
Note that the impact of using a Session object may vary depending on the specific API endpoint and network conditions involved, so it's a good idea to test the performance of the script with and without a Session object to determine if it provides any benefit.
0 commit comments