[QGIS-Developer] setting user-agent from QgsNetworkAccessManager or QNetworkRequest

Marco Lechner - FOSSGIS e.V. marco.lechner at fossgis.de
Tue Jul 11 06:20:56 PDT 2023


Hi,

in QGIS one can set the user-agent to a cutom value in the program 
options, but QgsNetworkAccessManager automatically adds "QGIS/.../.. " 
to the user-agent string.
Is there a way to completely set a custom user-agent string (without the 
QGIS addition?). How can I set the user-agent on QGIS plugin development 
when using QgsNetworkAccessManager with QNetworkRequest? 
QgsNetworkAccessManager seems to take care of the sytsem configuration. 
And therefore QGIS... is added there as well. How can this be changed? I 
do not want to use "requests" instead of QgsNetworkAccessManager.

Regards
Marco Lechner


More information about the QGIS-Developer mailing list