请看看以下代码,为什么下载的jsp文件0kb,是不是没有完全获得就关闭程序了
#include <QCoreApplication>
#include <QtNetwork>
#include <QHttp>
#include <QUrl>
#include <stdio.h>
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
QHttp *http;http=new QHttp();
QUrl *url=new QUrl("http://127.0.0.1:8080/webtest/test2.jsp?selection=composer&composer=Lee Actor");
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;
http->close();
return app.exec();
}