Select to view content in your preferred language

Is the QueryTask supposed to automatically use POST when necessary?

1999
2
05-21-2012 11:11 AM
RyanKoehnen
Occasional Contributor
QueryTask is working fine for me except when I generate a where clause that is longer than GET can handle. In that case it just cuts off the submitted URL after the "query" keyword. How do I force a POST?
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
Yes the QueryTask is automatically switching to HTTP POST when necessary (for example when the parameter length is greater than 2048).
There is no way to force a POST when a GET can work.

What kind of error do you get when a POST is used? Could you give us more infos on how to reproduce the issue?

Thanks
0 Kudos
RyanKoehnen
Occasional Contributor
My mistake, the IE debugger wasn't showing the POST... When I looked through Fiddler, I could see it as a POST.

For some reason the query is failing at the SDE level and my failure to see the POST in the IE debugger was leading down the wrong path.

The permissions are set up correctly, the layer draws correctly, the service sublayer is available for query on the REST page, but when the query is submitted, it takes far too long (much longer than it should). The same query works fine through arcmap, and the code I have to set up the query works fine with other layers and services.

On to the Rest or SDE forum I guess 😉
0 Kudos