Last active
June 17, 2016 20:29
-
-
Save matthewarkin/9089f6e9c2071c0036bd3b88b3bf27e3 to your computer and use it in GitHub Desktop.
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
<html> | |
<input type="file" id='fileForm' > | |
<input type="submit"onclick="submitForm()"> | |
<script> | |
submitForm = function(){ | |
var formData = new FormData(); | |
formData.append('purpose', 'identity_document'); | |
formData.append("file", document.getElementById("fileForm").files[0]); | |
fetch("https://uploads.stripe.com/v1/files", { | |
method: 'POST', | |
mode: 'cors', | |
headers: { | |
"Authorization": 'Bearer pk_test_BbfCyK5c89Xg8qeeSUqvqQaX', | |
"Content-Type": "multipart/form-data" | |
}, | |
body: formData | |
}) | |
.then(function(d){console.log(d)}) | |
} | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment