Skip to content

Instantly share code, notes, and snippets.

@alextanhongpin
Created September 3, 2017 14:42
Show Gist options
  • Save alextanhongpin/55b2dae9577423c6c099d312de2bdfb7 to your computer and use it in GitHub Desktop.
Save alextanhongpin/55b2dae9577423c6c099d312de2bdfb7 to your computer and use it in GitHub Desktop.
Sample fetch post for web
window.fetch('/v1/webpush', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
}).then((body) => {
return body.json()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment