PDA

View Full Version : QHttp request failed



xgoan
19th November 2008, 15:40
Hi,

I'm developing an application that need to get a pair of values from a web.

I have this piece of code:

QHttpRequestHeader header("POST", PATH); QString str=LOGIN_STRING;
QByteArray data=str.toUtf8();
header.setValue("Host", HOST);
header.setValue("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.4) Gecko/2008102920 "
"Firefox/3.0.4 (.NET CLR 3.5.30729)");
header.setValue("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
header.setValue("Accept-Language", "en-gb,en;q=0.5");
header.setValue("Accept-Encoding", "gzip,deflate");
header.setValue("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
header.setValue("Keep-Alive", "300");
header.setValue("Connection", "keep-alive");
header.setValue("Referer", REFERER);
header.setValue("Cookie", COOKIE);
header.setContentType("application/x-www-form-urlencoded");
header.setContentLength(data.length());
qDebug()<<header.toString();
http->setHost(HOST, QHttp::ConnectionModeHttps);
qDebug()<<http->request(header, data);And this sends the request correctly (I think), and this is the event log (SIGNALS connected to SLOTS)

2
request: 1
1 request finished
request: 2
status changed: 2
status changed: 3
send 586 586
status changed: 6
status changed: 0
status changed: 2
status changed: 3
send 586 586
status changed: 6
status changed: 0
status changed: 2
status changed: 3
send 586 586
status changed: 6
status changed: 0
2 request finished
doneAnd no response header and no data.

What's the problem?

Thanks

wysota
19th November 2008, 17:47
What is the status code of the second request?