gistlib
index.tsxconst axios = require('axios'); const url = 'https://api.github.com/your-api-endpoint'; const data = { // Add your data to be sent as payload }; const config = { headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your-access-token' } }; axios.post(url, data, config) .then((response) => { console.log(`Status: ${response.status}`); console.log(response.data); }) .catch((error) => { console.error(error); }); 467 chars23 lines
const axios = require('axios'); const url = 'https://api.github.com/your-api-endpoint'; const data = { // Add your data to be sent as payload }; const config = { headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your-access-token' } }; axios.post(url, data, config) .then((response) => { console.log(`Status: ${response.status}`); console.log(response.data); }) .catch((error) => { console.error(error); });
gistlibby LogSnag