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