Skip to content

Instantly share code, notes, and snippets.

@alexpaul
Created June 11, 2018 23:57
Show Gist options
  • Save alexpaul/149811beae237a37cfac84fceca4d45f to your computer and use it in GitHub Desktop.
Save alexpaul/149811beae237a37cfac84fceca4d45f to your computer and use it in GitHub Desktop.
Using Javascript's Fetch API to make a GET request
fetch('YOUR ENDPOINT HERE')
.then(response => response.json())
.then(jsonData => console.log(jsonData))
.catch(err => console.error(err))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment