I'm trying to get the request header but I'm not able to get it. I don't get anything with request.rawHeaderList().
My actual code looks like this:

Qt Code:
  1. def downloadFinished(self, reply):
  2. redirect = reply.attribute(QNetworkRequest.RedirectionTargetAttribute).toUrl()
  3. print "ERROR CODE: " + str(reply.attribute(QNetworkRequest.HttpStatusCodeAttribute).toInt())
  4. for item in reply.rawHeaderList():
  5. print "REPLY HEADER: " + str(item) + " === " + reply.rawHeader(str(item))
  6. request = QNetworkRequest(redirect)
  7. for item in request.rawHeaderList():
  8. print "REQUEST HEADER: " + str(item) + " === " + request.rawHeader(str(item))
  9. if not redirect.isEmpty():
  10. print "REDIRECT: " + str(redirect)
  11. self.reply = self.manager.get(request)
  12. self.reply.downloadProgress.connect(self.updateDataReadProgress)
  13. else:
  14. self.updateFile = QFile(self.downloadPath)
  15. self.updateFile.open(QIODevice.WriteOnly)
  16. self.updateFile.write(self.reply.readAll())
  17. self.updateFile.close()
  18. self.reply.deleteLater()
  19. self.manager.deleteLater()
  20. reply.deleteLater()
To copy to clipboard, switch view to plain text mode 

PS: Is it really that hard to make Qt act like urllib in python or wget/curl? Isn't really there something in Qt that will just work?