Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.

https://developers.arcgis.com/javascript/jshelp/ags_proxy.html

share|improve this answer
    
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 Mar 13 at 19:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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