Saturday, October 30, 2010

Cross domain XMLHttpRequest

It's not possible to use the ArcGIS Server REST API if your parameters have more than 2048 characters and you select HTTP GET. Of course, the REST API UI provides you the option to do an HTTP POST. But how do you do this programmatically?

You use a proxy!! ArcGIS Server provides you one here. More information oh how a proxy works can be found on the Yahoo Developer Network.

I named this post Cross domain XMLHttpRequest because in the context of ExtJS, the ScriptTagProxy doesn't support HTTP POST calls. Therefore, you would use HttpProxy (with a POST method) to access the proxy on the local server. Remember to pass the parameters as properties (instead of concatenating them to the URL).

No comments: