JavaScript · Middle · Question 40 of 75

What is CORS?

Explanation

Under the same-origin policy, the browser doesn't let a script read responses from another domain unless the server sends Access-Control-Allow-Origin. For "non-simple" requests, a preflight OPTIONS is sent first. It's a browser restriction: curl or a server don't apply it.

Further reading

Problem with a question

JavaScript · Middle · question 40

Test yourself

Take the JavaScript · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz