Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativexmlhttprequest / data / send_data.1.qml
1 import QtQuick 1.0
2
3 QtObject {
4     property string url
5
6     property bool dataOK: false
7
8     Component.onCompleted: {
9         var x = new XMLHttpRequest;
10         x.open("POST", url);
11         x.setRequestHeader("Accept-Language","en-US");
12
13         // Test to the end
14         x.onreadystatechange = function() {
15             if (x.readyState == XMLHttpRequest.DONE) {
16                 dataOK = (x.responseText == "QML Rocks!\n");
17             }
18         }
19
20         x.send("My Sent Data");
21     }
22 }