View Full Version : QtWebKit not able to execute $.post properly; json data missing on server side

12th June 2014, 12:37
Good day,

the following js code:

var xmlfn = "file.xml";
var json = "{\"command\":\"read\",\"fn\":\""+xmlfn+"\"}\n";
var jqxhr = $.post(
"http:" + port,

is not able to properly send the data section (json string) to the server side.
When using the Firefox/Chrome browser, the server output is:

"Connection: keep-alive"
"Content-Length: 41"
"Accept: text/plain, */*; q=0.01"
"User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/34.0.1847.116 Chrome/34.0.1847.116 Safari/537.36"
"Content-Type: application/x-www-form-urlencoded; charset=UTF-8"
"Accept-Encoding: gzip,deflate,sdch"
"Accept-Language: en-US,en;q=0.8,ja;q=0.6,de;q=0.4,pl;q=0.2"

but when I use the QWebView, the json part is missing (the socket reads two empty lines after the header).

The only clue I have found until now is that when I add
alert(json); to the js code, then Firefox/Chrome prints
whereas QWebView brings

Any ideas on how to make QtWebKit/QWebView send the json data to the server component?