Created
January 22, 2017 10:07
-
-
Save mactkg/7965480bab42f571eeef23d762f113fb 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
var gyazo_data = { | |
client_id: "ID_HERE", | |
image_url: "IMAGE_URL", | |
referer_url: "URL" | |
}; | |
var form_data = new FormData(); | |
for (var key in gyazo_data) { | |
form_data.append(key, gyazo_data[key]); | |
} | |
fetch('https://upload.gyazo.com/api/upload/easy_auth', { | |
method: 'POST', | |
mode: 'cors', | |
body: form_data | |
}).then(response => { | |
return response.json(); | |
}).then(function(json) { | |
console.log(json) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment