Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativexmlhttprequest / data / send_data.4.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("Content-Type", "charset=UTF-8;text/plain");
12         x.setRequestHeader("Accept-Language","en-US");
13
14         // Test to the end
15         x.onreadystatechange = function() {
16             if (x.readyState == XMLHttpRequest.DONE) {
17                 dataOK = (x.responseText == "QML Rocks!\n");
18             }
19         }
20
21         x.send("My Sent Data");
22     }
23 }
24