Select to view content in your preferred language

Request length/size constrain on Query API??

6201
4
03-05-2013 07:41 AM
deleted-user-Q-LwcOmvpdjW
Deactivated User
Hi,

I am having problems in using the query API. I need to use a polygon geometry to query a point layer so it returns all the intersecting points.
The formatted query looks something like:

http://myarcgisservice/MapServer/0/query?geometryType=esriGeometryPolygon&geometry={%22spatialReference%22:{wkid:xxx},%22rings%22:[[[x1,y1],[x2,y2],[x3,y3],...,[xn, yn],[x1,y1]]]}&f=json

It works fine when the geometry is not complex, but as the number of vertices is getting bigger, it starts to return me "400 Bad request" and "404" error. For example, if I have a polygon of more than 50 vertices, the query will return me "400" error...

I am wondering if there is a constraint/threshold on number of vertices of a polygon? Or there is a length constraint on the request (say, 255 characters)? I can't seem to find documentations on this...

Thanks!
0 Kudos
4 Replies
nicogis
MVP Alum
see http://help.arcgis.com/en/webapi/javascript/arcgis/jshelp/#ags_proxy
"... The application creates requests that exceed 2048 characters. While there is no official maximum length for a URL some modern browsers have imposed limits. Using a proxy works around this issue by performing a POST request rather than a GET request. POST requests are not limited by the 2048 character maximum because the information is transferred in the header instead of the URL. Common situations where you may exceed the URL length are:
-Buffer complex polygons then use the buffered geometry with a query task.
-Specify a spatial reference using well-known text (wkt)..."
0 Kudos
deleted-user-Q-LwcOmvpdjW
Deactivated User
see http://help.arcgis.com/en/webapi/javascript/arcgis/jshelp/#ags_proxy
"... The application creates requests that exceed 2048 characters. While there is no official maximum length for a URL some modern browsers have imposed limits. Using a proxy works around this issue by performing a POST request rather than a GET request. POST requests are not limited by the 2048 character maximum because the information is transferred in the header instead of the URL. Common situations where you may exceed the URL length are:
-Buffer complex polygons then use the buffered geometry with a query task.
-Specify a spatial reference using well-known text (wkt)..."


Thanks Domenico.

Actually I am using POST other than GET. The URL I posted is just an example. The problem happened whenever the json geometry shape is long.

Meng
0 Kudos
nicogis
MVP Alum
What's the version of your arcgis server (and service pack) ?
0 Kudos
GenhanChen
Deactivated User
I have the same issue with ArcGIS Server extension. I am using ArcGIS Server 10.0.

For the POST request, it works fine using the the request form generated by ArcGIS Server.

However, it failed when I wrapped the parameters in a json object, and sent a POST request with the json object to the endpoint directly.

Do you have a JavaScript example showing how to send a POST request to the extension?

Thanks!