I have several projects that use QNAM/QNetworkReply pretty heavily. They were
developed using Qt 5.4.2, and the networking works flawlessly.
However, I switched to Qt 5.6.2 and my networking stopped working. No errors,
my slots weren't even being invoked. The request just appears to vanish into
the ether.
I just tried Qt 5.7.1 and the same networking code is now returning
|ProtocolUnknownError (|error code 301).
The code being used for all three versions is very simply:
...
QUrl url(url_str);
url.setUserName(username);
url.setPassword(password);
QNetworkRequest request(url);
request.setRawHeader(QByteArray("Content-type"),
QByteArray("application/json"));
request.setRawHeader(QByteArray("Accept"), QByteArray("application/json"));
QNetworkReply* reply = QNAM->get(request);
connect(reply, &QNetworkReply::readyRead, this, &TeamCity::slot_get_read);
connect(reply, &QNetworkReply::finished, this,
&TeamCity::slot_get_complete);
connected = connect(reply, static_cast<void
(QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error),
this, &TeamCity::slot_get_failed);
...
This same code using the same URL works in 5.4.2, and variously doesn't in
later versions.
The URL is a REST API, and uses HTTPS.
Any hints about what might be going wrong here? Something new in 5.6 that I'm
not doing?
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest