Saving via proxy

Hello,

In this example (https://snippet.webix.com/745f2266), there’s a section for save that references the same link

save:{
“insert”:"//docs.webix.com/samples/server/films",
“update”:"//docs.webix.com/samples/server/films",
“delete”:"//docs.webix.com/samples/server/films"
}

How does my server code need to be structured for it to pick up what action to do? Would this all be in POST? or would there be 3 different calls, put, post, and delete?

Thank you for your help.

Hello @ljing, by default, if you don’t specify a proxy, all of the operations will be done with the POST method.

Still, you will be able to know exactly the type of operation performed from within the body of the request object. When performing a request, an additional field called webix_operation will be added to the object, specifying the type of operation being performed (i.e. “insert”, “delete”, “update”).

If you want to read more about data saving, you can get more information from this article.

If you are planning to use a REST proxy, this is a bit different in this case. Your request object won’t contain the webix_operation filed, but the type of request will vary depending on the operation performed, i.e. update will issue a PUT request, add will perform a POST request, delete will do a DELETE. You can even check the request type via this snippet - https://snippet.webix.com/5sekqjzw (this is done via DevTools - Network).

You can read more about the REST mode here.