add authorization header axios
// Send a GET request with the authorization header set to
// the string 'my secret token'
const res = await axios.get('https://httpbin.org/get', {
headers: {
'Authorization': 'my secret token'
}
});const username = ''
const password = ''
const token = Buffer.from(`${username}:${password}`, 'utf8').toString('base64')
const url = 'https://...'
axios.post(url, {
headers: {
'Authorization': `Basic ${token}`
}
})
Also in JavaScript:
- Javascript get random item from array
- use thymeleaf variable in javascript
- Iterate with Do While Loops Javascript
- multiple image upload react
- how to refrence image in dart angular
- query selector js
- jquery: get selected option of the drop down list
- jquery get textarea value
- add variable inside regex in javascript
- Generate random whole numbers javascript
- react toastify does not have design
- javascript queryselector
- table row count in jquery
- js split string
- angular emit output
- array includes
- javascript getdate
- forloop in js
- javascript encode url to decode C#
- turning an hex code to rgb discord.js
- js stop form submit
- react.strictmode
- jquery get table to object
- print array without brackets javascript