Skip to content

Instantly share code, notes, and snippets.

@dan-zheng
Created February 24, 2017 22:29
Show Gist options
  • Save dan-zheng/648e946ad3db01819db8f23771e4a1e4 to your computer and use it in GitHub Desktop.
Save dan-zheng/648e946ad3db01819db8f23771e4a1e4 to your computer and use it in GitHub Desktop.
An example of using superagent to access Purdue.io API.
const request = require('superagent');
request
.get('http://api.purdue.io/odata/Subjects')
.query({ $select: 'Name,Abbreviation' })
.then((res) => {
const subjects = res.body.value;
console.log(subjects);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment