Skip to content

Instantly share code, notes, and snippets.

@diem1
Last active March 10, 2016 18:27
Show Gist options
  • Save diem1/3adb8d62ea837fb096a8 to your computer and use it in GitHub Desktop.
Save diem1/3adb8d62ea837fb096a8 to your computer and use it in GitHub Desktop.
NodeJS JSON parse from URL via request module
var request = require("request")
var url = "http://developer.cumtd.com/api/v2.2/json/GetStop?" +
"key=d99803c970a04223998cabd90a741633" +
"&stop_id=it"
request({
url: url,
json: true
}, function (error, response, body) {
if (!error && response.statusCode === 200) {
console.log(body) // Print the json response
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment