Send request to the server using XMLHttpRequest on Gear S2
This code shows how to send request to the server using XMLHttpRequest on Gear S2.
// js
var client = new XMLHttpRequest();
client.open("GET", "https://cors-test.appspot.com/test");
client.onreadystatechange = function() {
if (client.readyState == 4) {
if(client.status == 200) {
console.log(client.responseText);
}
}
};
client.send();
// config.xml:
<access origin="*" subdomains="true"></access>
<tizen:privilege name="http://tizen.org/privilege/internet"/>