Hi Ravi, I have adjusted my code and have finally gotten deletes to work! Both deletefeatures and applyedits with a 'deletes' parameter works. However, I cannot get updates or adds to work. If I use applyedits in the same way as I use deletes, but instead pass an 'adds' or 'updates' parameter...nothing happens. To make sure the data is in the correct format, I actually do a 'query', then use the attributes and geometry returned to pass into 'updates' (after changing an attribute). I also use the geometry returned to pass into adds, with changed attributes (and NOT passing in OBJECTID). When looking in Firefox, I get the following as (for an add):
POST mywebserver/ArcGIS/rest/services/myfeatserc/FeatureServer/0/applyEdits
(in the POST tab)
Parameters: application/x-www-form-urlencoded
adds: [{geometry:[{x:-101.7599999997887,y:33.880000000046806, spatialReference:{wkid:4326}}], attributes:{ChngAtt:whatever}}]
f: json
Source:
adds=%5B%7Bgeometry%3A%5B%7Bx%3A-101.7599999997887%2Cy%3A33.880000000046806%2C%20spatialReference%3A%7Bwkid%3A4326%7D%7D%5D%2C%20attributes%3A%7BStation_Na%3Awhatever%7D%7D%5D&f=json
I am using the same method to post as I do with delete, so I get THE SAME in firefox with a delete...except there is not an "adds" parameter, there is a "deletes" with an objectid listed. I am only selecting one feature to update/add at this time so that the URL does not get too long. To test, I have also tried sending parameters: [{geometry:[{x:-101.7599999997887,y:33.880000000046806}], attributes:{ChngAtt:whatever}}] (no spatialReference) and [{geometry:{x:-101.7599999997887,y:33.880000000046806}, attributes:{ChngAtt:whatever}}] (no brackets around x & y).
Any suggestions as to what the applyedits method is looking for??