Current semantics:
* Create: HTTP POST /<entity type name> (requires HTTP Content-Type header
set to the MIME type of <format>)
* Update: HTTP PUT /<entity type name>/<entity id>.<format>
or HTTP PUT /<entity type name>/<entity id> (requires HTTP
Content-Type header set to the MIME type of the posted format)Requiring POST for create is fine now, I think. However, the PUT semantics still don't map to the regular update case. E.g. if a put a node.json having only the 'title' property set, the PUT semantics would imply that this is the only property value the node has then. However, the current code keeps other property values as well. This behaviour is useful, but that's no PUT. I'd argue we should use POST semantics for that as well.
I'm not sure we can or should support PUT semantics, Drupal is no plain data-store, the data gets massaged. Anyway, probably best would be mimic the behaviour as far as it makes sense, i.e. set all not provided property values to NULL in case of a PUT.
Comments
Comment #1
klausiThis is too late now for both RESTWS branches.
We are using PATCH in D8 REST module, so that would be the right thing for a 3.x branch.
Comment #1.0
klausifixed display