angular http: how to call images with custom headers?

前端 未结 5 2234
不思量自难忘°
不思量自难忘° 2020-12-09 03:28

In the html view, images are displayed like this:

 

element.image.url points to a

5条回答
  •  一向
    一向 (楼主)
    2020-12-09 04:00

    As far as I know it's not possible to pass additional headers with asset requests (scripts, images, media, CSS files that the browser loads while rendering the page). That's all controlled by the browser. Only when making a XHR (AJAX) request can you modify headers.

    I would suggest looking at your server side authentication and seeing if there's a solution there.

提交回复
热议问题