diff options
Diffstat (limited to 'tests/auto/declarative/xmlhttprequest/data/send_data.2.qml')
-rw-r--r-- | tests/auto/declarative/xmlhttprequest/data/send_data.2.qml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/declarative/xmlhttprequest/data/send_data.2.qml b/tests/auto/declarative/xmlhttprequest/data/send_data.2.qml new file mode 100644 index 0000000..79a27b6 --- /dev/null +++ b/tests/auto/declarative/xmlhttprequest/data/send_data.2.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=UTF-8"); + + // Test to the end + x.onreadystatechange = function() { + if (x.readyState == XMLHttpRequest.DONE) { + dataOK = (x.responseText == "QML Rocks!\n"); + } + } + + x.send("My Sent Data"); + } +} + |