i'm trying to get google calendar data from the account entered by user.
after authentication, the reply asks me to redirect to another page.

when redirecting to that page, it says your client made invalid request. The code is as follows:




QNetworkAccessManager *manager=new QNetworkAccessManager(this->parent());
QNetworkRequest request(QUrl("https://www.google.com/calendar/feeds/default/owncalendars/full"));
QString header="GoogleLogin auth="+auth;
request.setRawHeader("Authorization",header.toLoca l8Bit());
QNetworkReply *reply=manager->get(request);
QEventLoop loop;
QObject::connect(reply,SIGNAL(finished()),&loop,SL OT(quit()));
loop.exec();
QUrl redir=reply->attribute(QNetworkRequest::RedirectionTargetAttri bute).toUrl();
if(!redir.isEmpty())
{
QNetworkRequest req(redir);
req.setRawHeader("Authorization",header.toLocal8Bi t());
reply=manager->get(req);
QObject::connect(reply,SIGNAL(finished()),&loop,SL OT(quit()));
loop.exec();
}
this->ui->textBrowser_2->setText(redir.toString());
this->ui->textBrowser->setText(reply->readAll());



Is this not how we handle redirections??