How to implement an object property update using restful API?

Viewed 3227

What is the proper way of implementing an object property update using ServiceStack (message-oriented RESTful web service)?

If the client needs to update Foo.bar and only has Foo's id.

Should I accept a FooBarUpdate request object that includes the Foo id and Foo.bar value? This would mean that I have to create separate request for each property update, or at least for those that I expect to be updated (or a combination of them). This also doesn't seem to adhere to RESTful standards.

Alternatively, if I accept a Foo request object that includes the whole Foo with the updated properties, the client would first need to retrieve Foo and then the service would check which properties were updated. This seems like an unnecessary overhead.

Lastly, if I accept a Foo request but with only the id and the modified property value (Foo.bar), the Foo object is incomplete and according to other posts, this can lead to confusion where someone assumes it's a full object.

1 Answers
Related