ruben-mv / SOSClient

SOS plugin for QGIS
2 stars 2 forks source link

Content-Type should be application/xml in GetObservation POST request #5

Closed justb4 closed 9 years ago

justb4 commented 9 years ago

I found that the plugin is sending Content-Type: x-www-form-urlencoded for the GetObservation POST request. My SOS gives an error response. If I change this to Content-Type: application/xml in sos_client_dialog.py executeRequest like this:

def executeRequest (self, url, callback, post = None):
    self.messageBar.clearWidgets()
    self.cmbOfferings.setEnabled (False)
    self.tabWidget.setEnabled (False)

    if post:
        request = QNetworkRequest(url)
        request.setRawHeader('Content-Type', 'application/xml')
        self.reply = QgsNetworkAccessManager.instance().post(request,post)
    else:
        self.reply = QgsNetworkAccessManager.instance().get(QNetworkRequest(url))

then POST requests work ok.

ruben-mv commented 9 years ago

Will be fixed on next release.