Last active
October 20, 2020 13:25
-
-
Save navarroaxel/04e9b05a3cb5a99d39bf06c7560cba9a 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
const uploadPicture = async (staksName, uri) => { | |
const body = new FormData(); | |
body.append('file', {uri, type: 'application/octet-stream', name: 'file'}); | |
const response = await fetch('https://postman-echo.com/post', { | |
body, | |
method: 'POST', | |
accept: 'application/json', | |
'Content-Type': 'multipart/form-data', | |
}); | |
const data = await response.json(); | |
console.log({response, data}); | |
return data; | |
}; | |
uploadPicture('content://media/external/images/media/19520'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment