Skip to content

Instantly share code, notes, and snippets.

View mamezito-zz's full-sized avatar

Sergiy Voronov mamezito-zz

View GitHub Profile
send = ->
xhr = new XMLHttpRequest
url = baseUrl
xhr.open 'POST', url, true
xhr.setRequestHeader 'Content-type', 'application/json'
xhr.setRequestHeader 'Authorization', 'Bearer ' + accessToken
xhr.onreadystatechange = ->
if xhr.readyState == 4 and xhr.status == 200
print JSON.parse(xhr.responseText)