I'm trying to download a private Google Calendar using a QNetworkAccessManager. Google offers an iCal export function through URLs similar to https://www.google.com/calendar/ical/[MY E-MAIL ADDRESS]/private-[RANDOM STRING OF LETTERS AND NUMBERS]/basic.ics. This calendar can be accessed by other applications through this URL, as described in Google Calendar's documentation.
I use the following code to download a file from a given URL.
// _naMgr is a function member of type QNetworkAccessManager
connect(&_naMgr, SIGNAL(finished(QNetworkReply*)), this, SLOT(buildCalendar(QNetworkReply*)));
_naMgr.get(QNetworkRequest(_url));
// _naMgr is a function member of type QNetworkAccessManager
connect(&_naMgr, SIGNAL(finished(QNetworkReply*)), this, SLOT(buildCalendar(QNetworkReply*)));
_naMgr.get(QNetworkRequest(_url));
To copy to clipboard, switch view to plain text mode
void Calendar::buildCalendar(QNetworkReply* reply) {
_content = reply->readAll();
// TODO: debug
msg.setText(_content);
msg.exec();
}
void Calendar::buildCalendar(QNetworkReply* reply) {
_content = reply->readAll();
// TODO: debug
QMessageBox msg;
msg.setText(_content);
msg.exec();
}
To copy to clipboard, switch view to plain text mode
So then I tried downloading my private calendar through the URL provided by Google. This works fine in Chromium, vanilla Firefox (i.e. no prior session data or cookies) and cURL. However, when I try to access the URL through my little program I am served with this Dutch error page. (It says "Feed Processing Error".)
Is there something specific in Qt's way of handling URLs that may cause Google's server to respond differently?
Bookmarks