0

How can I force the urlUtils to use only POST requests. I a using it as shown in the following block described also in the how to use proxy section, and I have noticed that some times (maybe when the request is less than 2000 characters ) it performs GET request, which in my case is not an accepted solution.

urlUtils.addProxyRule({
urlPrefix: "route.arcgis.com",
proxyUrl: "<url_to_proxy>"
});
3
  • 1
    I think you're barking up the wrong tree. The web requests themselves determine whether a GET or POST is submitted, not the proxy rule. In esri.request this means specifying usePost:true in the request JSON. On dojo forms it means using form.method = "post". Without the relevant code it's impossible to answer beyond 'You can't.'
    – Vince
    Commented Mar 25, 2015 at 14:21
  • I have created a proxy on my own .. that hears on post requests. An I would like to avoid GETs. I know how the web works. But I would expect that arcgis and urlUtils could provide such a capability.
    – Smalis
    Commented Mar 25, 2015 at 16:12
  • 1
    urlUtils doesn't, because that's not its purpose. The JSAPI does, because I use it. You haven't provided a query, so no one can show you how to specify a POST method.
    – Vince
    Commented Mar 25, 2015 at 16:31

1 Answer 1

1

Vince is correct the best way is to use the JSAPI to specify usePost:true.

docs at https://developers.arcgis.com/javascript/3/jsapi/esri.request-amd.html

the only other way to force the SDK to generate a post is to ensure that the query string is over 2000 characters by appending some meaningless values such as where="1=1 and 1=1"

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.