aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml
blob: cd125adf86459c19f985fb05c73c7c17e603553b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import QtQuick 1.0

QtObject {
    property string url

    property bool dataOK: false
    property bool done: false
        
    Component.onCompleted: {
        var x = new XMLHttpRequest;
        x.open("GET", url);

        x.onreadystatechange = function() {
            if (x.readyState == XMLHttpRequest.DONE) {
                done = true;
                dataOK = x.responseText == "Redirected\n";
            }
        }

        x.send();
    }
}