Skip to content

Instantly share code, notes, and snippets.

@pinkhominid
Last active April 19, 2019 03:11
Show Gist options
  • Save pinkhominid/28f045452c34211b488e13aee35f9dd9 to your computer and use it in GitHub Desktop.
Save pinkhominid/28f045452c34211b488e13aee35f9dd9 to your computer and use it in GitHub Desktop.
Fetch in console
fetch('/api/things')
.then(res => res.json())
.then(res => console.log(res))
@pinkhominid
Copy link
Author

Yes, technically that is 3 lines, but only for readability. Here it is one-true-line..
fetch('/api/things').then(res => res.json()).then(res => console.log(res))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment