Created
February 24, 2017 22:29
-
-
Save dan-zheng/648e946ad3db01819db8f23771e4a1e4 to your computer and use it in GitHub Desktop.
An example of using superagent to access Purdue.io API.
This file contains hidden or 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
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