0

I am using an API endpoint URL which returns a byte array of content-type: image.

This endpoint will be used in the src attribute of the image tag to display the image.

I am doing this because the image is to be displayed in an email client and the client deletes the src attribute if I use a base64 string

The endpoint I am using has a mandatory correlation-id in the header.

How can I use the endpoint URL in the src attribute of an image tag with the mandatory correlation-id

SAVe
  • 814
  • 6
  • 22
Akhil Ravindran
  • 121
  • 1
  • 7
  • Does using an absolute image path in src works? – kiranvj Jul 05 '19 at 13:26
  • 2
    You cannot add custom headers to a HTML ``. Perhaps you can proxy the request through your own backend that doesn't require the header but requests the image data from the actual endpoint URL after adding the correlation-id header? – rickdenhaan Jul 05 '19 at 13:27
  • The image is stored in a private bucket so I cannot use the absolute image path in src. If I use the image data(in base64string) in src google email client strips it out. – Akhil Ravindran Jul 05 '19 at 13:54
  • An alternative option would be to attach the image to the email with a [ContentID](https://stackoverflow.com/a/19139153/1941241) attribute which you can then use in the ``. – rickdenhaan Jul 05 '19 at 15:25

0 Answers0