From my understanding, PUT can be used to insert or modify existing record.
PUT to a URL creates/replaces the resource in its entirety at the client defined URL.
PUT: www.domain.com/accounts/1
{
Name: "Some Name"
}
Following request would create account with ID 1, but in the next request it would simply update/replace account with ID 1 which makes it idempotent.
How does this work with identity columns in relational databases, or any other database which supports auto generated identity?
If my accounts have auto generated SQL identity column, should I use property other than primary key to identify that resource in the database, or it is perfectly fine to return resource not found error upon request for non existing resource?