Created
May 18, 2020 15:57
-
-
Save itsalb3rt/3a950269009b39d01b84d299818de498 to your computer and use it in GitHub Desktop.
Send Authorization header for get audio file or something
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
const fetchAudioFile = async (url, authorizationToken) => { | |
const result = await fetch(url, { | |
headers: { | |
Authorization: authorizationToken | |
}, | |
}); | |
const blob = await result.blob(); | |
return URL.createObjectURL(blob) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment