Will be great if Drupal 8 implement PUT REST state to update entities instead of POST, PUT is the standard for Update process, Front End framework like Backbone JS use this State for Update.

CommentFileSizeAuthor
#1 enable_put_method_to-2399813-1.patch7.69 KB-enzo-
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

-enzo-’s picture

I did a patch to implement REST State PUT for entity updates, this patch was created on top patch #2300677: JSON:API POST/PATCH support for fully validatable config entities.

Summary of patch
Add a new Method: PUT
Add a new format: form handle by JSON serialize

ToDo.

The logic save the entity but don't receive properly the values send by client

pcambra’s picture

From https://groups.drupal.org/node/284948

Perhaps the biggest stumbling block has been the HTTP PUT method. Based on our experience so far, the REST team has decided the best course of action is to simply drop support for it from the rest.module in Drupal 8.

I think PATCH is preferred.

klausi’s picture

Status: Needs work » Postponed (maintainer needs more info)

Did you try PATCH with backbone? It should work nearly identical to PUT, except that you only have to send fields that you want to change.

-enzo-’s picture

OHH I didn't know that.

OK I will work in that direction, and inform my results thanks @klausi

clemens.tolboom’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

I can confirm patch is working on hal+json so closing this.