Skip to content

Instantly share code, notes, and snippets.

@george-i
Last active March 13, 2019 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save george-i/fbb74a4a96255ddf62119daf827194c0 to your computer and use it in GitHub Desktop.
Save george-i/fbb74a4a96255ddf62119daf827194c0 to your computer and use it in GitHub Desktop.
Create Warp @ kiwi
var data = new FormData();
data.append("name", "Breakup Party");
data.append("location", "Icecream Factory");
data.append("group_type", "Public");
data.append("start_date", "06-23-2019 11:00:00");
data.append("longitude", "-74.0059728");
data.append("latitude", "40.7127753");
data.append("spayc_category_id", "160");
data.append("payment_type", "Free");
data.append("image", "C:\\path\\to\\image\\filename.jpg");
data.append("end_date", "06-24-2019 11:00:00");
data.append("description", "Icecream for everyone");
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/spaycs.json");
xhr.setRequestHeader("TOKEN", "<YOUR_TOKEN>");
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