Created
June 15, 2018 02:03
-
-
Save dceddia/276876d2c3804a38966af5872b6d5535 to your computer and use it in GitHub Desktop.
Upload pictures to the server
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
uploadPicture = () => { | |
return fetch(SERVER_URL, { | |
body: JSON.stringify({ | |
image: this.state.photo.base64 | |
}), | |
headers: { | |
'content-type': 'application/json' | |
}, | |
method: 'POST' | |
}) | |
.then(response => response.json()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment