nsidc / qgreenland-plugin

Other
4 stars 2 forks source link

Get rid of the `requests` module #4

Closed ghtmtt closed 3 years ago

ghtmtt commented 3 years ago

QgsNetworkAccessManager is more suitable to use within QGIS because it handles all the user settings (like proxy). Here a ode snippet as prototype:

network_request = QNetworkRequest(QUrl('http:/....'))

reply = QgsNetworkAccessManager.instance().blockingGet(network_request) 
assert reply.error() == QNetworkReply.NoError, reply.errorString()
return json.loads(reply_content.data().decode())
ghtmtt commented 3 years ago

fixed by #1