Select to view content in your preferred language

JSONP Request blocked due to mime type mismatch

736
0
03-10-2020 01:32 PM
TimDavis1
New Contributor

I have an ArcGIS Server site that serves mapping resources and another site that makes requests to the ArcGIS Server site via the REST API. At some point in the past everything was working. Now the request is blocked by the browser due to mime type mismatch. The ArcGIS Server site is returning a Content-Type header with text/plain;charset=utf-8. I think the browser is expecting application/javascript.

The request URL looks something like this: <servername>/ArcGIS/rest/services/<folder>/ThematicLayersWMAS/MapServer/2/query?f=json&where=1%20%3D%201&returnGeometry=true&spatialRel=esriSpatialRelIntersects&maxAllowableOffset=1000&outFields=NAME&callback=dojo.io.script.jsonp_dojoIoScript2._jsonpCallback

The response looks something like this:

dojo.io.script.jsonp_dojoIoScript2._jsonpCallback({"displayFieldName":"NAME","fieldAliases":{"NAME":"NAME"},"geometryType":"esriGeometryPolygon","spatialReference":{"wkid":102100,"latestWkid":3857},"fields":[{"name":"NAME","type":"esriFieldTypeString","alias":"NAME","length":12}],"features":[{"attributes":

I've tried adding *. and *.jsonp mime types for the ArcGIS Server site in IIS, but that didn't change anything.

Is there a way to configure the Content-Type that is returned by the ArcGIS Server?

Thanks

0 Replies