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
Replace existing usages of requests
with NetworkClient
#11018
Comments
requests
with NetworkClient
to ensure proper timeouts; it's also now smarter when given a NetworkLocation
requests
with NetworkClient
Yes, that would be great. The first thing to do would be to look for places in the codebase where the The next step would then to start replacing them with usage of the NetworkClient class. The best example of using the NetworkClient class for requests can be found here: kolibri/kolibri/core/discovery/api.py Line 91 in e67339e
|
The
The requests module will still be used in |
@andreamisuraca I'm sorry, we missed this. We'll reach out. |
Hi @andreamisuraca - apologies for missing this! We definitely don't need to replace in the build_tools. One of the main motivations for using the NetworkClient is to ensure we have a user agent that shows this is Kolibri - we may want to look into how we can use it in Exceptions can be kept the same, as it is still using requests under the hood - we're just wrapping it to ensure consistency! |
May I work on this? |
Hi @thesujai, yes, thank you |
Background
We've made our
NetworkClient
utility more flexible and incorporated sensible default timeouts and a custom user agent. It's also now smarter when given aNetworkLocation
.Goals
There are several usages of
requests
that bypass the custom behavior ofNetworkClient
. Ideally they should be refactored to use theNetworkClient
instead. Some additional functionality and flexibility may be required to handle all other use cases ofrequests
.The text was updated successfully, but these errors were encountered: