Skip to main content

Custom HTTP headers in `fetch` in plugins


Jiri_Prokop

Hello,

I’m creating an internal Figma Plugin and I noticed that your fetch function is custom one and that not all HTTP headers are exposed by it. In fact, only content-length and content-type seems to be available.

My plugin would need to read additional information from the header since I’m using binary data (image) in the response and I don’t want to implement multipart form parsing just to add these small data (HTTP header would be very practical for it).

Is there any solution? For now I’m using a workaround to pass that data in content-type but as you can imagine, that’s not ideal 🙂

Thank you for any help.
Jiri

2 replies

tank666
  • 4863 replies
  • July 28, 2023

You can call the plugin’s invisible UI to access the Browser API.


Jiri_Prokop

Yeah, that’s a good idea. But this will complicate my logic, I’m afraid.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings