Plus:- The requests package might not be installed in UserX's system and thus your plugin might just not work unless the user knows how to install Python packages manually. urllib would always be available (though it does not do PATCH without some tiny monkey patching: https://stackoverflow.com/a/9023005/4828720) so use that if you really can't use the builtin PyQGIS API.
Cheers, Hannes Am 06.02.22 um 23:22 schrieb Nyall Dawson:
On Tue, 1 Feb 2022 at 18:10, Julien Cabieces <julien.cabie...@oslandia.com> wrote:I think one good solution is to use the request python framework (https://3.python-requests.org/)(for wider reference in case anyone comes across this thread in search results:) In general, it's better NOT to use requests and stick with the native PyQGIS network API instead. There's a number of reasons why using requests for QGIS plugin is discouraged: - It doesn't respect QGIS network settings, like the proxy settings - It doesn't use the standard QGIS handling of authentication and dealing with things like SSL errors - Requests aren't logged via the Network Logger panel NyallRegards, Julien
OpenPGP_0xBF7B268A77C202D5.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer