[Qt-interest] QHttp getting empty response

Paul Miller paul at fxtech.com
Tue Sep 27 19:54:52 CEST 2011


On 9/27/2011 10:47 AM, Thiago Macieira wrote:
> On Tuesday, 27 de September de 2011 10:31:24 Paul Miller wrote:
>> I have some QHttp code using Qt 4.7
>
> You should use QNetworkAccessManager, which has been available since 4.4.

Okay I ported to QNetworkAccessManager and I keep getting 301 "Moved 
Permanently" errors from the server now.

I am building the request like this:

QNetworkRequest req(server_url);
reply = net->post(req, queryString.toUtf8());

Which is similar to what I was doing before (URL was just the host, 
query data is my query string - basically a bunch of form name=value pairs).

My server guy tells me the request isn't even getting to him.

No matter what I try I always get back a web page from the server with a 
301 error telling me the document has been permanently moved, with the 
new address being the URL in the request.

I also tried it with a GET which should have sent me a different page at 
least and that generated the same result as well.

The old QHttp API is working fine. Any ideas?



More information about the Qt-interest-old mailing list