I wrote this RestXQ [1] to mock it. Just copy it into restxq.xqm...
When I call it like [2] I get [XPTY0004] Cannot convert xs:base64Binary to xs:string: "IntcImFcIjpcImJcIn0i". This is because the response is seen as a binary and this can be double checked calling with [3].The strange thing however is that I get the same error when calling like [4] with override-mime-type set to text/json or application/json which instead I was expecting to work.
Is the behaviour in this scenario expected or does this hide some inconsistency?
Thanks, as usual, for the support.
Regards,
Marco.
[1][3]
json:parse(
convert:binary-to-string(
http:send-request(<http:request
method="get"/>,"http://localhost:8984/mc/dummy")[2]
)
)