Skip to content

Instantly share code, notes, and snippets.

@itsalb3rt
Created May 18, 2020 15:57
Show Gist options
  • Save itsalb3rt/3a950269009b39d01b84d299818de498 to your computer and use it in GitHub Desktop.
Save itsalb3rt/3a950269009b39d01b84d299818de498 to your computer and use it in GitHub Desktop.
Send Authorization header for get audio file or something
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