Last active
March 13, 2019 04:52
-
-
Save george-i/4320e7dc14545af7c74055c002473c65 to your computer and use it in GitHub Desktop.
Correct API call for Warp/events app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = new FormData(); | |
data.append("center_latitude", "40.785091"); | |
data.append("center_longitude", "-73.968285"); | |
data.append("endpoint_latitude", "38.889931"); | |
data.append("endpoint_longitude", "-77.009003"); | |
data.append("radius", "20000"); | |
var xhr = new XMLHttpRequest(); | |
xhr.withCredentials = true; | |
xhr.addEventListener("readystatechange", function () { | |
if (this.readyState === 4) { | |
console.log(this.responseText); | |
} | |
}); | |
xhr.open("POST", "http://spayc-staging.kiwireader.com/api/map-spaycs.json"); | |
xhr.setRequestHeader("TOKEN", "<YOUR_TOKEN>"); | |
xhr.setRequestHeader("timezone", "America/New_York"); | |
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); | |
xhr.setRequestHeader("cache-control", "no-cache"); | |
xhr.send(data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment