datatable sends a POST instead of a PUT

I have a form and a datatable bound to the same data. When a row in the datatable is selected it shows up in the form. I also have a button to copy the selected row to a new row. So far so good.
When I copy a new row a POST is send by the grid to the REST-API.
If I then edit the row in the form another POST is send which results in an edited copy of the already copied row.
However when I refresh the page and then edit the new row a PUT is send, which updates the selected row. This is the correct behaviour.
Can I manually trigger a PUT in stead of a POST or should I somehow reload the data first?

What is the response of the REST-API, is it a valid JSON object ?

If response is not valid, component will use POST request for next call, as it hasn’t valid confirmation for data saving.

You’re right the JSON return is not valid.
I tried to adjust your examples to MySQL but MySQL doesn’t seem to have the same methods as SQLite.
lastInsertRowID() should be lastInsertID()

Thanks again Maksim !