Select to view content in your preferred language

Add/Insert Record with Javascript via POST?

1009
2
07-06-2010 07:41 AM
KeithFraley
Emerging Contributor
I am trying to figure out the best way to add a record via pure javascript.  I think the only way to accomplish this is doing to AGS via the REST api.

Does anyone have a working example of this?

Thanks!
0 Kudos
2 Replies
derekswingley1
Deactivated User
The easiest way would be to use the JS API's feature layer and applyEdits():  http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#applyEdits

You could hit the REST endpoint directly to insert your features but why reinvent the wheel?
0 Kudos
RaviKonaparthi
Deactivated User
Hi,

In order to POST request to add feature using applyEdits method, you need to use proxy file which is provided by ESRI.

Regards,
Ravi.
0 Kudos