Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Qt unable to get redirected url response

$
0
0
I want to download image by using this link http://interactiveplaylist.com/art/mbidlarge.php?mbid=53ccdacc-3e3e-449b-995e-b280666dc28c but on get method url it redirect to another url i.e. http://userserve-ak.last.fm/serve/174s/89255431.jpg, this url has the actual image that I want to download but it gives me error#406 because server is redirected. I am using code as below: QNetworkRequest requestCover;     requestCover.setUrl(QUrl(coverurl));     QNetworkAccessManager *downloadmanagerCover = new QNetworkAccessManagerr( parent);         downloadreplyCover = downloadmanagerCover->get(requestCover);     connect(downloadmanagerCover,SIGNAL(finished(QNetworkReply*)),this,SLOT(onFinishedCover(QNetworkReply*)));     connect(downloadreplyCover,SIGNAL(readyRead()),this,SLOT(onReadyRead()));     connect(downloadreplyCover,SIGNAL(finished()),this,SLOT(onReplyFinishedCover())); void AcoustidClient::onFinishedCover(QNetworkReply * reply) {     switch(reply->error())     {     case QNetworkReply::NoError:     {       }break;     default:{         qDebug()<<"file is not downloaded successfully."<<newUrl;           qDebug(reply->errorString().toLatin1());     };     }     } } Do anyone have any idea.

Viewing all articles
Browse latest Browse all 13965

Trending Articles