Created
September 4, 2017 21:43
-
-
Save killtheliterate/bd669e92d368053d3a19d0ab7f3d0458 to your computer and use it in GitHub Desktop.
This file contains 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
window.fetch('/endpoing', { | |
method: 'POST', | |
body: new window.FormData(file) | |
}) | |
// add something to check for 200 etc. | |
.then(res => res.json()) | |
.then(console.log) | |
.catch(console.error) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment