The server should respond with an HTTP status of 200, most likely, and should return any data that the server generates or updates for the model. As a rule, this is only the id type generated by the server. Any fields returned from the server will be applied to the model. Therefore, if you send this to the server:
{ foo: "bar" }
and server response with this:
{ id: 1, // or some other server generated ID, from a database, etc. message: "SUCCESS" }
Your model will look like this:
{ id: 1, foo: "bar", message: "SUCCESS" }
If your model does not need any data updated from the server when calling the save method, you must return an empty object literal {} .
source share