axios - http request
December 24, 2022
axios - http request
Axios is a promise-based network request library for node.js and the browser. It provides a convenient wrapper around http requests.
CloudControl Pro has built-in version 0.21.1 of this module, and you can use axios without installing it. Of course, you can also install other versions of axios by yourself without worrying about conflicts with the built-in version.
Tips
"nodejs";
const axios = require('axios');
async function main() {
// Make a request to the user with the given ID
try {
const res = await axios.get('https://www.google.com');
console.log(res);
} catch (e) {
console.error(e);
}
}
main();
Please refer to axios docs for more API introductions and examples.