[QGIS-Developer] QgsBlockingNetworkRequest and PATCH method (Python)

Johannes Kröger (WhereGroup) johannes.kroeger at wheregroup.com
Mon Feb 7 00:53:18 PST 2022


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.cabieces at 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
>
> Nyall
>
>
>>
>> Regards,
>> Julien

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xBF7B268A77C202D5.asc
Type: application/pgp-keys
Size: 2476 bytes
Desc: OpenPGP public key
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20220207/942516ab/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 665 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20220207/942516ab/attachment.sig>


More information about the QGIS-Developer mailing list