Skip to content

Instantly share code, notes, and snippets.

Created November 16, 2018 23:19
What would you like to do?
fetch('', {
credentials: 'include', // Useful for including session ID (and, IIRC, authorization headers)
.then(response => response.json())
.then(data => {
console.log(data) // Prints result from `response.json()`
.catch(error => console.error(error))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment