Last active
March 10, 2016 18:27
-
-
Save diem1/3adb8d62ea837fb096a8 to your computer and use it in GitHub Desktop.
NodeJS JSON parse from URL via request module
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
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