Hi Marco,
an introductory question: what’s your particular reason for splitting the operation in two parts? Do you perform database updates in the pre-validation step?
It works nicely up to the access to the POST content which appears to be consumed defintely by the first function.
That’s right: POST bodies can only be consumed once. We could think about extending the rest:forward-Syntax in order to construct a new body, but that’s just an idea (and I’m not sure if this is supported by the Java request dispatcher).
Moreover there is no possibility of stating that the postbody may possibly be empty, is it?
This should generally be possible. I have tried the following RESTXQ function:
declare %rest:path("/post") %rest:POST("{$x}") function rest:main($x) { $x };
It doesn’t trigger an error when calling it with:
curl -XPOST -i "http://localhost:8984/post"
Could you provide me with a little example of your code that causes the problem? Christian