I've written some code to query a Feature Layer using either a QueryTask or using the setDefinitionExpression when adding the layer.

For testing I am using the ASP.Net Development Server.

I've noticed (via Fiddler) that when my "where" statement is large, my request automatically changes from a GET to a POST. Occasionally however my request fails with an "esri.config.defaults.io.proxyUrl is not set." error.

In researching this error I have found that it may be due to the length of the URL exceeded the maximum length, and that to workaround this issue I should use a proxy, in order to perform a POST. I am however confused by this because I am already seeing my requests change from using a GET to a POST.

When performing a query using a large where clause,does the request in fact get changed from a GET to a POST when necessary? If so, is the use of a proxy still necessary in this case.

1 Answer 1


your assumption is correct. the JSAPI switches to POST automatically when required. If the request is interpreted as being sent to a different domain than where the application resides and either the service handling the query or browser don't support CORS, a proxy is required.


  • Interestingly I've had to revert to using a Proxy. While using setDefinitionExpression for a Feature layer it started to fail when the query string was large. I would see a message in the console saying that the esri.config.defaults.io.proxyUrl is not set. Very Confusing.
    – Peter
    Commented Mar 13, 2015 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.