Yes!
Just as Taffy supports multiple output formats through the use of
Serializers, you may use
Deserializers to parse post-body data (traditionally only used for POST and PUT requests, though I think Taffy will parse it no matter what verb is used, if you send one).
By default, it is assumed you want to accept JSON input data. If you want to accept anything else, you'll need to write a custom deserializer.
If you send a request like so (line 2 is the body text):
POST /foo/bar
{ "widgets": 4 }
Then the CFC with
taffy:uri="/foo/bar" will get its POST method called, with the following
argumentCollection:
{ widgets: 4 }
Sending an object as the body will map the keys in the object to the method arguments. So:
function post( widgets ){ ... }
will be called like this: post( argumentCollection: { widgets: 4 } );
If you want, you can post an array instead of an object as the request body:
POST /foo/bar
[ "a", "b", 42 ]
And the default Deserializer that ships with taffy will send this to your resources as _body (note: still deserialized, not as a string):
post( argumentCollection: { _body: [ "a", "b", 42 ] } );