My case:
page with parameter can download:http://www.a2gold.com/index_en.php
page without parameter,can't download:http://feymercurial.com/forum/profil...wprofile&u=873
Code:
int main(int argc,char *argv[])
{
//QUrl *url=new QUrl("http://feymercurial.com/forum/profile.php?mode=viewprofile&u=873"); [COLOR="red"] //this can't download. [/COLOR]
QUrl *url
=new QUrl("http://www.a2gold.com/index_en.php");
[COLOR
="Red"] //this can download. [/COLOR]
http->setHost(url->host(),80);
int httpGetId=http->get(url->path(),file);
qDebug() << httpGetId;
return qapp.exec();
}
int main(int argc,char *argv[])
{
QApplication qapp(argc,argv);
QHttp *http;
http=new QHttp();
//QUrl *url=new QUrl("http://feymercurial.com/forum/profile.php?mode=viewprofile&u=873"); [COLOR="red"] //this can't download. [/COLOR]
QUrl *url=new QUrl("http://www.a2gold.com/index_en.php"); [COLOR="Red"] //this can download. [/COLOR]
QFileInfo fileinfo(url->path());
QFile *file = new QFile(fileinfo.fileName());
file->open(QIODevice::WriteOnly);
http->setHost(url->host(),80);
int httpGetId=http->get(url->path(),file);
qDebug() << httpGetId;
return qapp.exec();
}
To copy to clipboard, switch view to plain text mode
how can i download a page with a parameter?
Bookmarks