You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently resource controllers use same route for PATCH and PUT.
I wonder if this is intentional. I find myself needing to separate the two.
Thank you for the amazing framework.
Background
PUT documentation states that it "creates a new resource or replaces a representation of the target resource" whilst A PATCH request is "considered a set of instructions on how to modify a resource".
So they are supposed to differ in their functionality.
Typically this would mean that this payload:
{
"name": "foo"
}
would override all fields with PUT (or create a new one), whilst PATCH would only update the name field leaving other fields untouched.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
Currently resource controllers use same route for PATCH and PUT.
I wonder if this is intentional. I find myself needing to separate the two.
Thank you for the amazing framework.
Background
PUT documentation states that it "creates a new resource or replaces a representation of the target resource" whilst A PATCH request is "considered a set of instructions on how to modify a resource".
So they are supposed to differ in their functionality.
Typically this would mean that this payload:
would override all fields with PUT (or create a new one), whilst PATCH would only update the
name
field leaving other fields untouched.Beta Was this translation helpful? Give feedback.
All reactions