kenya888

Untitled

May 2nd, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. import QtQuick 1.1
  2.  
  3. Rectangle {
  4. width: 360
  5. height: 360
  6. Text {
  7. text: qsTr("Hello World")
  8. anchors.centerIn: parent
  9. }
  10. MouseArea {
  11. anchors.fill: parent
  12. onClicked: {
  13. var test
  14. var request = new XMLHttpRequest()
  15. request.open('HEAD', 'https://api.twitter.com/1.1/help/tos.json')
  16. request.setRequestHeader("Content-Type", "application/json");
  17. request.onreadystatechange = function() {
  18. console.debug('################')
  19. console.debug(request.readyState)
  20. console.debug(request.status)
  21. console.debug('################')
  22. if( request.readyState === XMLHttpRequest.HEADERS_RECEIVED && request.status === 400 ) {
  23. test = true
  24. console.debug(test)
  25. console.debug(request.responseText)
  26. }
  27. }
  28. request.send()
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment