Skip to content

Instantly share code, notes, and snippets.

@justsml
Created November 16, 2018 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justsml/3ddd9ed8705f48cdf45d313d1e57aa2a to your computer and use it in GitHub Desktop.
Save justsml/3ddd9ed8705f48cdf45d313d1e57aa2a to your computer and use it in GitHub Desktop.
fetch('https://api.github.com/orgs/nodejs', {
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