So I am not actually using Esri's JavaScript API in this case, but am trying to make a request using the standard axios library to an ArcGIS Server endpoint.
const fs = "https://srvesridev4w.eon.local:6443/arcgis/rest/services/EON/FAA/MapServer/0";
const config = {
method: 'post',
url: fs,
data:{where:"LocationID='LAX'", f:"json"},
}
const results = await axios.request(config); It returns the following error:
'https://srvesridev4w.eon.local:6443/arcgis/rest/services/EON/FAA/MapServer/0' from origin 'http://localhost:8080' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.
Everything in the documentation says ArcGIS Server is CORS enabled (we're using 10.6.1), and in fact using Esri's JavaScript API does not generate these CORS errors (what I'm trying to accomplish does not justify the overhead the JS API creates). So this would indicate the issue is on the front end, but any headers I add to the request doesn't help. Does anyone have any suggestions?