axios .get .post code example
Example 1: axios get
import axios from 'axios';
await axios.get('/user', {
params: {
ID: 12345
}
})
Example 2: how to make request with axios
const axios = require('axios');
async function makeGetRequest() {
let res = await axios.get('http://webcode.me');
let data = res.data;
console.log(data);
}
makeGetRequest();