axios set authorization header
// 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}`
}
})
const username = ''
const password = ''
const token = Buffer.from(`${username}:${password}`, 'utf8').toString('base64')
const url = 'https://...'
const data = {
...
}
axios.post(url, data, {
headers: {
'Authorization': `Basic ${token}`
},
})
Also in JavaScript:
- string split last slash in js get previous results
- string concat javascript
- expo build apk
- node.js server
- js change text on hover
- cordova read file in www folder
- javascript variable with multiline text
- dart map to json string
- react native debugger
- get id by this jquery
- corresponding text to key code js
- scrollbar position
- mongoose query with function(req, res, next)
- Done button press event ReactJS keyboard PWA
- cesar ciupher js
- read file javascript
- javascript array push
- how to access router from the store vue
- turning an hex code to rgb discord.js
- evaluatejsonpath array json
- javascript select all table rows
- array includes
- title case javascript
- calculator