Page MenuHomePhabricator

Use only one entry point for all http requests
Open, MediumPublicFeature

Description

Feature summary:
Use only one entry point for all http requests. Due to T68102 all http requests should be make through pywikibot.comms.http but there might me reasons to use the underlying requests package within framework or scripts. Related modules can be found here.

Use case(s):
There are other http libraries which can be used instead of request. Having only one central entry point for the underlying http module enables to switch from one module to an other if the API is simular or use it as an alternative. This can be done like:

try:
    import httpx as requests
except ImportError:
    import requests

Benefits:
httpx may be a good candidate because in addition to the synchonous processing it also supports asynconous coroutines which may help to implement concurrent processing for I/Os which are not treat save. This would help to solve T57889 or more special T314121.