这是我的程序。在这个程序中,我想向一个网站发送请求(例如: http: //www.adobe.com/products/muse.html)
我想在纯文本框中显示返回我的 html 代码。
QUrl url("http://www.adobe.com/products/muse.html")
我想在“thisfile”中给出 html 代码
file.setFileName("thisfile.html");
if (!file.open(QIODevice::WriteOnly))
{
std::cerr << "Error: Cannot write file "
<< qPrintable(file.fileName()) << ": "
<< qPrintable(file.errorString()) << std::endl
return false;
}
http.setHost(url.host(),80);
http.post(url.toString(),"term=yyyy&loc=en_us&siteSection=products%3Amuse",&file);
此代码无法正常工作,当我显示文件时给我错误的 html 代码。我需要做什么?