I'm using the esri/request module. I can get items just fine, but I'm not able to delete items as I should be able to.
I am using the url format shown in the ArcGIS REST API, like so: http://www.arcgis.com/sharing/rest/content/users/username/items/itemid/delete ,
but the error I am getting is "invalid token <".
I then tried putting a "?f=json" on the end of the url, just to find out more. This time, the error I got back was "405 method not allowed".
Is there a way to delete content using the esri.request module? I am authenticated with OAuth 2.0 and the esri/identityManager, so that shouldn't be a problem (and I can see my private items using the get request with the esri/request module).
Solved! Go to Solution.
Are you sending the JSON data via a POST request?
All other HTTP methods should result in the 405 error. See this page in the ArcGIS REST API
Are you sending the JSON data via a POST request?
All other HTTP methods should result in the 405 error. See this page in the ArcGIS REST API
I was able to get it to work after all. It turns out that I had to pass the token in the content attribute for the request, not as part of the url.