diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml')
-rw-r--r-- | tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml new file mode 100644 index 0000000..e048769 --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml @@ -0,0 +1,23 @@ +import Qt 4.6 + +QtObject { + property string url + + property bool dataOK: false + + Component.onCompleted: { + var x = new XMLHttpRequest; + x.open("POST", url); + x.setRequestHeader("Content-Type", "text/plain;charset=latin1"); + + // Test to the end + x.onreadystatechange = function() { + if (x.readyState == XMLHttpRequest.DONE) { + dataOK = (x.responseText == "QML Rocks!\n"); + } + } + + x.send("My Sent Data"); + } +} + |