PATCH verb and httpmethod overriding

66 views
Skip to first unread message

Steven Neiland

unread,
Mar 31, 2014, 1:27:12 PM3/31/14
to taffy...@googlegroups.com
What if any support does taffy have for the PATCH verb? I have a use case that is best matched by this verb but I don't see any explicit support for it in the documentation. As I understand it, the PATCH verb should operate similar to the PUT verb in that it expects a json string in the body to represent the fields being updated. Is this possible in the current version of taffy or should I raise an enhancement request.

Also while I'm talking about it, because of the limitations in the Adobe implementation of cfhttp it would be useful to add method overriding for when a client does not explicitly support the patch verb (or any other one).

For example the salesforce api makes extensive use of the PATCH verb but to allow client libraries/systems which do not support it, the salesforce team allow for th method to be overridden with a url variable e.g. "https://salesforceapiurl?_HttpMethod=PATCH" so that the client can do a PUT or a POST instead and taffy would know to override the detected verb with the specified verb behavior.

Adam Tuttle

unread,
Mar 31, 2014, 2:18:50 PM3/31/14
to taffy...@googlegroups.com
Hey Steve,

I am fairly certain that simply adding a PATCH method to your resource should get you most of the way there. You /might/ need to submit a PR to get Taffy to parse the request body for patch requests (I think it explicitly only does so when the verb is put or post right now). If so, should be a pretty easy change to make. ;)

As for overriding the method, Taffy uses the standard X-HTTP-Method-Override header (and the standard is to do so with the POST verb, though I don't think it matters to Taffy)...

Does that help? 

Adam


--
You received this message because you are subscribed to the Google Groups "Taffy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taffy-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steven Neiland

unread,
Mar 31, 2014, 2:32:34 PM3/31/14
to taffy...@googlegroups.com
Thats exactly what I needed thanks. :)

Steven Neiland

unread,
Mar 31, 2014, 2:33:41 PM3/31/14
to taffy...@googlegroups.com
If I end up needing to modify taffy to parse the body on a patch I'll make sure to do a pull request.

Adam Tuttle

unread,
Mar 31, 2014, 2:36:21 PM3/31/14
to taffy...@googlegroups.com
Reminder: Feature branch! ;)

Adam


On Mon, Mar 31, 2014 at 2:33 PM, Steven Neiland <steven....@gmail.com> wrote:
If I end up needing to modify taffy to parse the body on a patch I'll make sure to do a pull request.

--

Steven Neiland

unread,
Mar 31, 2014, 3:02:06 PM3/31/14
to taffy...@googlegroups.com
Lol I'll remember. Can you point me to where you detect to do the body parsing?

Steven Neiland

unread,
Mar 31, 2014, 3:07:11 PM3/31/14
to taffy...@googlegroups.com
Never mind, I see it.

Adam Tuttle

unread,
Mar 31, 2014, 3:07:14 PM3/31/14
to taffy...@googlegroups.com
Looks like it should be fine without changes. Have you tested it?


Adam

Steven Neiland

unread,
Apr 18, 2014, 7:25:49 PM4/18/14
to taffy...@googlegroups.com
Not yet, I've been working on something else so I have not gotten back to that part of the project. I will let you know when I do.

Jean-Bernard van Zuylen

unread,
May 10, 2014, 6:12:53 AM5/10/14
to taffy...@googlegroups.com
Hello,

I've submitted a pull request (https://github.com/atuttle/Taffy/pull/206) for the support of the PATCH verb.

Jean-Bernard

Adam Tuttle

unread,
May 12, 2014, 8:49:04 AM5/12/14
to taffy...@googlegroups.com
Hot! Thanks Jean-Bernard! Merged it in this morning.

Adam
Reply all
Reply to author
Forward
0 new messages