Hi Christian,
No luck.
I'm using Postman. I already had Content-Type = application/json and Accept = application/json. I tried changing it to application/json;format=map (btw do you think it's necessary to have the basex/restxq specific pseudo attributes (format= etc) in the HTTP request headers?)
I'm seeing 400 errors like this:
[bxerr:BASX0003] Input could not be converted: "POST.xml" (Line 1): No text allowed before root element.
So something is different now but still there seems to be an expectation somewhere on the post being XML at least the filename suggests so.
The documentation is a bit contradictory:
"The body of a POST or PUT request will be converted to an XQuery item. Conversion can be controlled by specifying a content type. It can be further influenced by specifying additional content-type parameters:"
The table below lists:
application/jsonJSON Optionsdocument-node()
On Mon, Aug 3, 2015 at 4:42 PM, Christian GrĂ¼n christian.gruen@gmail.com wrote:
Hi Marc,
declare %rest:POST("{$body}") %rest:path("/json") %rest:consumes("application/json;lax=yes;format=map") %rest:produces("application/json;format=map")
If I remember right, content-type parameters in rest annotations will be ignored, because these annotations only serve as filters. Instead, you will need to specify the content-type parameters client-side (in your POST or PUT request).
Hope this helps, Christian