Looking to enhance Ajax.Request with additional headers, I have constructed the requestHeader object:
requestHeaders: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET,POST,PUT,DELETE,OPTIONS',
'Access-Control-Allow-Headers': 'Access-Control-Allow-Origin'
}
However, upon inspecting my request in the browser, I am unable to locate these headers. The console displays the error message:
"XMLHttpRequest cannot load . Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers."
Any solutions for resolving this issue?