Ostatnio pracuję nad telefonami Nokia za pomocą Qt-Qml. Muszę wysłać żądanie POST do danego URL-a HTTPS. Używam QML i próbuję zrobić to w JavaScript bez żadnego szczęścia.Https POST/GET z Qml/Qt
Ktoś ma pomysł na ten temat? Można to zrobić za pomocą JavaScript w QML? Dowolna porada, jak zrobić to w QT?
Próbowałem wywołanie funkcji takiego:
var http = new XMLHttpRequest()
var url = "myform.xsl_submit";
var params = "num=22&num2=333";
http.open("POST", url, true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
print("ok");
}else{
print("cannot connect");
}
}
http.send(params);
'XMLHttpRequest.DONE' jest łatwiejsze do zapamiętania niż' 4' , Myślę ... –