node-fetch auth basic
fetch(url, {
...options,
headers: {
'Authorization': 'Basic ' + btoa(`${username}:${password}`)
}
})
.then(response => response.json())
.then(json => console.log(json));// for node-fetch
fetch(url, {
...
headers: {
'Authorization': 'Basic ' + Buffer.from(`${username}:${password}`, 'binary').toString('base64')
}
...
})
Also in JavaScript:
- clear all intervals javascript
- easy peasy state management with react native
- ngfor select angular
- get attribute value jquery href
- w3schools angular
- rest api node js with mysql
- import svg react
- reactnode prop-types
- javascript set html select value
- display amount with currency for jquery
- java script remowechild an element from the DOM
- Cannot assign to read only property 'value' of object '[object Object]
- javascript input onchange get value
- Javascript check if undefined
- decet wheter react app in development or production
- how to add onclick to child element created javascript
- readfile nodejs
- angular input value
- rafraichir page javascript
- cannot create an instance of an abstract class httphandler angular
- jquery validation plugin
- interval javascript
- scroll down up js
- mongoose if empty string is provided use default