API Design · Junior · Question 54 of 75
Why are CORS preflight OPTIONS requests sent?
- ✓Correct answer: Before 'non-simple' cross-origin requests (e.g. JSON body, custom headers), the browser asks the server which methods and headers are allowed
- 2To log in
- 3To measure latency
Explanation
Servers can reduce preflights with Access-Control-Max-Age, which lets browsers cache the answer.