[Qt-interest] QHttp getting empty response

Paul Miller paul at fxtech.com
Tue Sep 27 17:31:24 CEST 2011


I have some QHttp code using Qt 4.7 that builds a custom request header 
and then waits for a response from the server. This code has been 
working for years, on Mac, Windows, and Linux.

Recently, we've gotten a fair number of people who are not getting 
anything back in the response -just empty data. They are all on Windows 
7. We're trying to figure out what else is common among them but I 
wanted to see if anyone had seen anything like this. I'm building the 
header like this:

QHttpRequestHeader header("POST", url.toString());
header.setValue("Host", url.host());
header.setValue("Accept", 
"text/xml,application/xml,application/xhtml+xml,text/html");
header.setValue("Accept-Charset", "ISO-8859-1,utf-8");
header.setValue("Accept-Language", "en-us,en");
header.setValue("Connection", "keep-alive");
header.setValue("User-Agent", "Mozilla/4.0 (compatible; MSIE 7.0; 
Windows NT 6.0)";);
header.setValue("Content-Type", "application/x-www-form-urlencoded");

The request is hitting the server and we've confirmed the server is 
responding with the proper data.

In the "done" slot I'm reading the response like this:

    QByteArray data = http->readAll();

The response data is a simple string though - not actually XML or HTML. 
I'm wondering if certain anti-virus software or something else could be 
looking at the response packets, noticing they are not really XML/HTML, 
and filtering them out.

Any suggestions?



More information about the Qt-interest-old mailing list