I am trying to call an ArcGIS service using Fiddler but I can't seem to get it to return data.
Request:
GET http://services1.arcgis.com/xxxxxxxxxxxx/ArcGIS/rest/services/WorldTimeZonesNamed/FeatureServer/query?layerDefs=0&geometryType=esriGeometryEnvelope&geometry={xmin:-109.55,ymin:25.76,xmax:-109.55,ymax:25.76,spatialReference:{wkid:4326}}&f=json HTTP/1.1 User-Agent: Fiddler Host: services1.arcgis.com Content-Length: 0
Response:
HTTP/1.1 200 OK Content-Type: text/plain; charset=utf-8 Server: Microsoft-IIS/8.5 X-ArcGIS-Instance: MTSDS_Web_IN_14 X-Powered-By: ASP.NET Access-Control-Allow-Origin: * Date: Wed, 24 Aug 2016 14:43:19 GMT Content-Length: 98
{"error":{"code":400,"message":"","details":["Operation without query criteria is not allowed."]}}
What am I doing wrong here?
It turns out I needed to specify which output fields should be returned (outFields=*). I was also able to use a point geometry type instead of an envelope so I could send a single coordinate pair instead of an envelope (rectangle):
GET http://services1.arcgis.com/xxxxxxxxxxxx/ArcGIS/rest/services/WorldTimeZonesNamed/FeatureServer/0/query?geometry={'x':-55.748800,'y':48.758563}&geometryType=esriGeometryPoint&outFields=*&returnGeometry=false&f=json HTTP/1.1 User-Agent: Fiddler Host: services1.arcgis.com Content-Length: 0