Skip to content
Advertisement

Accessing in Chrome POST response body from Cloudflare Worker

I am trying to read a response from a Cloudflare Worker API, I have not set anything sepcial about it and in Postman the request works as expected. I am guessing I am missing some header but I am not sure which one or even if that is the reason reading the reponses body is not working in browser.

This is how I fetch the data:

JavaScript

Looking forward to your answers, thank you.

Advertisement

Answer

This behaviour is due to the no-cors config of the fetch-api. For more details read about opaque requests here:

What limitations apply to opaque responses?

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement