Created
January 28, 2019 00:51
-
-
Save huming2207/3ac13caedcdd756f1137df62ea24a8d4 to your computer and use it in GitHub Desktop.
Axios test
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 axios = require('axios'); | |
axios.get('http://api.openweathermap.org/data/2.5/weather', { params: { | |
q: 'Shaoshan,CN', | |
appid: 'bad3e42bbdd0c77587f16d3c9b4145e3', | |
units: 'metric' | |
}}).then(function (resp) { | |
console.log(resp.data); | |
}).catch(function (err) { | |
console.log(err); | |
}).then(function () {console.log("done")}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment