Home >Web Front-end >JS Tutorial >What Are the Limitations and Considerations for Using Opaque Responses in Cross-Origin Requests?
Limitations and Considerations for Using Opaque Responses
Opaque responses, introduced by the Fetch API, represent the outcome of cross-origin requests when CORS is disabled. While they provide some isolation, there are several restrictions and potential issues to be aware of.
Restrictions on Headers and Body Access
The primary limitation of opaque responses is the inability to access the headers or body of the response. Properties like headers and body-related methods (json(), text()) are unavailable. This is essential to preserve the privacy of the remote origin.
Resource Usage and Limitations
Despite their limitations, opaque responses can be utilized as resources on a webpage if the browser allows non-CORS cross-origin resources. These resources include