I am getting 403 error even I can download through the web.
Am I doing this wrong ?
the reply from finished()
if (_reply->error() || replyCode != 200) {
qDebug() << _reply->errorString() << " code: " << replyCode;
return;
}
if (_reply->error() || replyCode != 200) {
qDebug() << _reply->errorString() << " code: " << replyCode;
return;
}
To copy to clipboard, switch view to plain text mode
void DownloadFromServer::GetTheFile() {
qDebug() << "DownloadFromServer::GetTheFile()";
QNetworkAccessManager *http = new QNetworkAccessManager(this);
QNetworkRequest request(url);
_reply = http->get(request);
connect(_reply, SIGNAL(finished()), SLOT(finished()));
connect(_reply, SIGNAL(downloadProgress(qint64,qint64)), SLOT(downloadProgress(qint64,qint64)));
qDebug() << "DownloadFromServer::GetTheFile() " << url.toString();
_loop.exec();
}
void DownloadFromServer::GetTheFile() {
qDebug() << "DownloadFromServer::GetTheFile()";
QUrl url(_url);
QNetworkAccessManager *http = new QNetworkAccessManager(this);
QNetworkRequest request(url);
_reply = http->get(request);
connect(_reply, SIGNAL(finished()), SLOT(finished()));
connect(_reply, SIGNAL(downloadProgress(qint64,qint64)), SLOT(downloadProgress(qint64,qint64)));
qDebug() << "DownloadFromServer::GetTheFile() " << url.toString();
_loop.exec();
}
To copy to clipboard, switch view to plain text mode
Added after 1 11 minutes:
ok, so my problem is that I give the url already escaped , so now question how to disable escaping in QUrl()
Added after 8 minutes:
I am talking to my self
answer: url.addEncodedQueryItem()
Bookmarks