How to deal with cookie with fetch, http.request and image-source?


I find in the doc there are fetch, http.request and image-source to get images from backend.
The backend requires login first.
Afterwards, I will request an image at http://xxx/img.png.
But the doc does not specify how to access the image content via the responce with fetch or http.request.
While the doc of image-source does not tell how to set cookie.


Cookies are not supported at this moment, there is a open feature request and you may vote there -

You will have to either change your backend’s behavior, send parameters instead of cookies. Or write a plugin to serve the purpose.