rewrite the code to use QNetworkAccessManager instead of requests