The front end uses get request to do an export download function, how to add request header data?

clipboard.png

the backend gives a get request for export and download. Originally, there is no problem with the download function, but then a token, needs to be added to the request header with Authorization: token,. How to add the request header information with the window.open get address?

Jan.08,2022

window.open cannot modify the request header. If it is a download function, you can send a get request and let the server set the response header format. If Content-Type, is set to application/octet-stream, browser, it will download

by default.
Menu