Pre-flighted JavaScript requests

GET request with custom request header


For JavaScript code to make a cross-origin GET request with a custom header, the response to the pre-flight request must include the Access-Control-Allow-Headers header.


  1. Hit green button below
  2. Verify response body contains header value
  3. Optionally check network requests in Developer Tools (F12)
View source on GitHub | Created by Tom Gregory