Reputation: 21137
I must fulfill a web service with PUT
as method to send changes. This service is used to change configurations. So, for example, if I send {"varA":true}
to url/configurationchage
it sets the corresponding variable, and if I send {"varB":true}
it changes varB
without affecting varA
.
I always though that PUT
(and searching google it seems as if I am right) just overwrites the resource (or creates it if not existing). Which I think would mean that I always have to send all variables, or the ones that are not sent will be deleted. So, is the behavior of this web service correct??
WITH EXAMPLES
PUT {"varA":true}
Resource content: {"varA": true}
PUT {varB:true}
happening: Resource content: {"varA": true, "varB":true}
what I think should happen: Resource content: {"varB":true}
Upvotes: 0
Views: 750
Reputation: 42027
No, it's not. You probably want to look at the PATCH method instead (see http://greenbytes.de/tech/webdav/rfc5789.html)
Upvotes: 2