Code: Alles auswählen
#include <iostream>
using namespace std;
#include <QHttp>
#include <QApplication>
#include <QIODevice>
#include <QBuffer>
#include <QByteArray>
#include <QUrl>
#include <QEventLoop>
int main(int argc, char**argv)
{
QApplication app(argc, argv);
QBuffer buffer;
QEventLoop loop;
QHttp client;
client.setProxy("proxy.irgendeine_url.com", 8080); //Proxy nicht öffentlicht, daher geändert
client.setHost("www.faznet.de");
QObject::connect(&client, SIGNAL(done(bool)), &loop, SLOT(quit()));
client.get("/s/Rub/Tpl~Epartner~SRss_.xml", &buffer);
loop.exec();
QByteArray bytes;
bytes = buffer.buffer();
cout << bytes.data() << endl;
}
Code: Alles auswählen
sHost=faznet.de sUrl=/s/Rub/Tpl~Epartner~SRss_.xmlIch nutze Qt 4.5 auf Windows XP SP2, compiler ist Dev-CPP mit MinGW G++ 3.4.2