aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml
blob: 0894573ecc93c45ff24af56b48e9f1fb2803dd21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import QtQuick 2.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.status == 302;
            }
        }

        x.send();
    }
}