Skip to content

Calling an IFS Cloud REST API from PHP or plain browser JavaScript fails (even though the exact same request works fine in Postman, and works in Chrome only when launched with --disable-web-security) — what's the actual fix, rather than disabling browser security?

Answer

This is a CORS (Cross-Origin Resource Sharing) restriction being enforced by the browser — Postman doesn't enforce CORS the way browsers do, which is why it works there regardless. Add an Access-Control-Allow-Origin header to the HTTP response, either set to * to allow any origin, or scoped to a specific list of known, trusted URLs instead of * for a more locked-down setup. This needs to be configured on the server/API side rather than worked around by disabling browser security settings, which isn't viable for real end users anyway.

← Browse Integrations and APIs questions