JavaScript : window.open with Http Header
fetch ( sUrl , { headers : { ' myHeader ' : ' ABCD ' } } ) // FETCH BLOB FROM IT . then ( ( response ) => response . blob ()) . then ( ( blob ) => { // RETRIEVE THE BLOB AND CREATE LOCAL URL var _url = window . URL . createObjectURL ( blob ) ; window . open ( _url , " _blank " ) . focus () ; // window.open + focus } ) . catch ( ( err ) => { console . log ( err ) ; } ) ; Reference from : stackoverflow.com