equal
deleted
inserted
replaced
|
1 import Qt 4.7 |
|
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=latin1;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 |