Generation

generate functionSun, 13 Nov 2022

Use Axios to post data to a url with a authorization token

const axios = require('axios'); axios.post('http://server.com/users', { firstName: 'Fred', lastName: 'Flintstone' }, { headers: { Authorization: 'Bearer YOUR_TOKEN_HERE' } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });

Javascript
Generate More

Want to kickstart your project?Use the new AI Studio to create your code