blob: bda5871a184d511bf14afe74659d92a83a0d6b9c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import QtQuick 2.0
QtObject {
property string url
property bool dataOK: false
property bool headerOK: false
Component.onCompleted: {
var x = new XMLHttpRequest;
x.open("OPTIONS", url);
// Test to the end
x.onreadystatechange = function() {
if (x.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
headerOK = (x.getResponseHeader("Allow") == "GET,HEAD,POST,OPTIONS,TRACE");
} else if (x.readyState == XMLHttpRequest.DONE) {
dataOK = (x.responseText == "");
}
}
x.send();
}
}
|