I am querying different ArcGIS Services passing a polygon as the input geometry to get the features from the service that intersect with it. However, depending on the polygon's geometry I get sometimes the following error when attempting to do the query:
Server Error
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Doing tests with different polygons I realized that the query failed when the polygon's geometry was too large, regardless of the service being queried. For example, a query with a polygon composed of 11 vertices worked fine but one with a polygon composed 65 vertices failed. All tests were carried out in the ArcGIS REST interface (using Chrome), in Python (using requests
) and Postman, yielding the same results.
Reading the ArcGIS REST API documentation was not helpful as it does not specify whether there is a character limit in the input geometry.
How can I query an ArcGIS Service using a long geometry as one of the inputs?
-
2All web servers have a limit on URL content. Coordinates should always be submitted in a POST, both for privacy and for data volume.Vince– Vince2019年07月10日 15:37:41 +00:00Commented Jul 10, 2019 at 15:37
1 Answer 1
The problem is solved by changing the request method from GET
to POST
. Given the difference between these two methods, it makes sense that using GET
to do the query including large geometries as input results in an error (as the input parameters are appended to the URL rather than to the body of the request).
[...] Main difference between POST and GET method is that GET carries request parameter appended in URL string while POST carries request parameter in message body [...]
Explore related questions
See similar questions with these tags.