Button { text: "Fetch" onClicked: { var xhr = new XMLHttpRequest() xhr.open("GET", "https://api.example.com") xhr.onreadystatechange = function() { if (xhr.readyState === XMLHttpRequest.DONE) console.log(xhr.responseText) } xhr.send() } }