Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 1.1
- Rectangle {
- width: 360
- height: 360
- Text {
- text: qsTr("Hello World")
- anchors.centerIn: parent
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- var test
- var request = new XMLHttpRequest()
- request.open('HEAD', 'https://api.twitter.com/1.1/help/tos.json')
- request.setRequestHeader("Content-Type", "application/json");
- request.onreadystatechange = function() {
- console.debug('################')
- console.debug(request.readyState)
- console.debug(request.status)
- console.debug('################')
- if( request.readyState === XMLHttpRequest.HEADERS_RECEIVED && request.status === 400 ) {
- test = true
- console.debug(test)
- console.debug(request.responseText)
- }
- }
- request.send()
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment