xdmp.getRequestBody( [$format as String?] ) as Object?
For PUT requests, returns the body of the request. For POST requests, returns the body of the request if it is not of content-type application/x-www-form-urlencoded.
Returns the empty sequence if it is not called from an application server.
|$format||The format ("xml", "text", or "binary") to interpret the body as. If not supplied, the format associated with the content-type header in mimetypes.xml is used. If no content-type header exists, the default format is "binary".|
If the content-type of the POST body is application/x-www-form-urlencoded,
it is not available here, but instead is available in its decoded form
If there is no content-type header in the request, then the request
body defaults to application/x-www-form-urlencoded, and therefore
xdmp:get-request-body will return the empty sequence. If
you want to read the request body, then the POST must include a
You can use this function to process certain types of web service SOAP requests with MarkLogic Server.
The output of an
xdmp:get-request-body call is
typically a document node, so if you want to get the contents of
the POST, you should add a
/node() XPath step to
the output. The contents of the document node could be a text node,
an element node, or a binary node.
xdmp.getRequestBody(); => "Contents of POST body."