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

Popular posts from this blog

SAP CPI - Loop Process Call with SuccessFactor (oData V2)

Setting IntelliJ IDEA to run Groovy Script

C# - BASE64 to Image