debmag
22nd October 2008, 22:02
Hi,
I've a small problem.
How did use this class for complete my login webpage ?
A part of my code :
QApplication app(argc, argv);
QByteArray content("login=root&passwd=root");
QHttpRequestHeader header("POST", "login.yahoo.com/config/login?");
header.setValue("Host", "login.yahoo.com/config/login?");
header.setContentType("application/x-www-form-urlencoded"); // important
header.setContentLength(content.length());
// request
QFile file("result.html");
QHttp http("login.yahoo.com/config/login?");
http.request(header, content, &file);
QUrl url2(http->text());
app.connect(&http, SIGNAL(done(bool)), &app, SLOT(quit()));
I'm test with this code, but this open a browser without complete value.
QUrl url("https://login.yahoo.com/config/login?");
url.setUserName("login=root&passwd=root");
QDesktopServices::openUrl(url);
Where the mistake please ?
Thx
I've a small problem.
How did use this class for complete my login webpage ?
A part of my code :
QApplication app(argc, argv);
QByteArray content("login=root&passwd=root");
QHttpRequestHeader header("POST", "login.yahoo.com/config/login?");
header.setValue("Host", "login.yahoo.com/config/login?");
header.setContentType("application/x-www-form-urlencoded"); // important
header.setContentLength(content.length());
// request
QFile file("result.html");
QHttp http("login.yahoo.com/config/login?");
http.request(header, content, &file);
QUrl url2(http->text());
app.connect(&http, SIGNAL(done(bool)), &app, SLOT(quit()));
I'm test with this code, but this open a browser without complete value.
QUrl url("https://login.yahoo.com/config/login?");
url.setUserName("login=root&passwd=root");
QDesktopServices::openUrl(url);
Where the mistake please ?
Thx