Created
November 16, 2018 23:19
-
-
Save justsml/3ddd9ed8705f48cdf45d313d1e57aa2a to your computer and use it in GitHub Desktop.
This file contains 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
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