Created
July 20, 2020 10:51
-
-
Save sabljakovich/2abf795f76944a3e8eccc4667461912f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Manual approach, there is a better way | |
const token = `${USERNAME}:${PASSWORD}`; | |
const encodedToken = Buffer.from(token).toString('base64'); | |
const headers = { 'Authorization': 'Basic '+ encodedToken }; | |
const user = await axios.post(BASE_URL+'/users', data, { headers }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment