Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davidystephenson/9883a0b7612a5ffe5945fde5aa6f1685 to your computer and use it in GitHub Desktop.
Save davidystephenson/9883a0b7612a5ffe5945fde5aa6f1685 to your computer and use it in GitHub Desktop.
<script>
async function upload () {
const review = { message: 'Those are some cute dogs!' }
const reviewJson = JSON.stringify(review)
const init = {
method: "POST",
body: reviewJson
}
const response = await fetch('https://dog.ceo/api/breeds/image/random', init)
const data = response.json()
console.log('data', data)
}
upload()
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment