简体   繁体   中英

How to call an ArcGIS rest service using Fiddler?

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?

As the error message says, you need to send the where Clause parameter along with the request. If there is no condition then you should send "1=1" as your criteria.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM