First off, thank you for the fast answer to my previous question. Now, I'm having trouble understanding how to send JSON to BaseX. Ultimately, I want to send JSON and store it (allowing BaseX to convert it to XML first, of course). For now, however, I am having trouble just receiving the JSON data. Here's my test XQM file: module namespace hwxdocs = "urn:com:hortonworks:docs"; declare %rest:POST("{$body}") %rest:path("hello/json") %rest:consumes("application/json") %output:media-type("application/json") function hwxdocs:hello2( $body ) { "Request body: " || $body }; I send data with this command: curl -iL -X POST \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data-binary '{"foo":{"bar":"baz"}}' \ http://localhost:8984/hello/json I expect to get Request body: {"foo":{"bar":"baz"}} (I’m assuming I can pass '{"foo":{"bar":"baz”}}’ to json:parse to convert to a BaseX XML that can be stored in the database.) However, instead, I get Request body: baz Can someone tell me what my error is? Thank you, Robert