2023-02-26 01:30
This commit is contained in:
15
getting-started/13_https_request_with_axios.js
Normal file
15
getting-started/13_https_request_with_axios.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const axios = require('axios').create({
|
||||
headers: { 'User-Agent': 'Elex Node' }
|
||||
});
|
||||
|
||||
axios
|
||||
.post('https://www.elex-project.com/', {
|
||||
id: 1234, message: 'Hello~'
|
||||
})
|
||||
.then((response) => {
|
||||
console.log(`httpStatus: ${response.statusCode}`);
|
||||
console.log(response.data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
Reference in New Issue
Block a user