I would like to add a token in my GET request in C++/Qt.
This is my GET / download method :
QNetworkReply* DownloadManager::doDownload(const QUrl &url)
{
QNetworkRequest request(url);
QNetworkReply *reply = m_manager.get(request); // m_manager is a QNetworkAcessManager
return reply;
}
The tokens are sent as part of the request header, so for that case we use the
setRawHeader()
method:In the case of the token we use the following: