xxxxxxxxxx
npm i axios
const axios = require('axios');
(OR)
window.axios = require('axios');
(OR)
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
axios.get("https://fakestoreapi.com/products/")
.then(function (res){
console.log(res.data);
})
xxxxxxxxxx
axios.get("/path", (res) => {
res.json(
}).then(data => console.log(data))
xxxxxxxxxx
axios.get("http://localhost:5000/products", (req,res) => {
res.json()
}).then(data => console.log(data))
dat.map(()) data in table
xxxxxxxxxx
fetch(`https://discord.com/api/oauth2/token`, {
method: "POST",
body: params
}).then(response => response.json()).then(data => {
axios.get("https://discord.com/api/users/@me", make_config(data.access_token)).then(response => {
console.log(data.access_token)
res.status(200).send(response.data);
}).catch(err => {
console.log(err);
res.sendStatus(500);
});
});
xxxxxxxxxx
fetch(`https://discord.com/api/oauth2/token`, {
method: "POST",
body: params
}).then(response => response.json()).then(data => {
axios.get("https://discord.com/api/users/@me", make_config(data.access_token)).then(response => {
console.log(data.access_token)
res.status(200).send(response.data);
}).catch(err => {
console.log(err);
res.sendStatus(500);
});
});fetch(`https://discord.com/api/oauth2/token`, {
method: "POST",
body: params
}).then(response => response.json()).then(data => {
axios.get("https://discord.com/api/users/@me", make_config(data.access_token)).then(response => {
console.log(data.access_token)
res.status(200).send(response.data);
}).catch(err => {
console.log(err);
res.sendStatus(500);
});
});