Dear Marco,
This was added in BaseX 11.4 — https://basex.org/2024/10/02/basex-11.4/
[FIX] XQuery: better support for JSON payloads in HTTP requests
Sorry if this caused troubles!
Best from Konstanz Michael
Am 12.02.2025 um 20:21 schrieb Marco Lettere m.lettere@gmail.com:
Dear Christian et al,
moving to basex 11.7 today I've found out that it is not necessary to serialize the body content in an http-request such as [1]. If I do (as I had to up to Basex 10.7) the body is no longer understood.
Now I obtsain correct behaviour when using code as in [2].
Can you confirm this change in behaviour? And if yes, this has a huge impact on the many many http calls we have so maybe it should be documented?
Thanks a lot as usual!
M.
[1]
let $body := json:serialize(<json type="object"/>)
return
<http:request href="url" method="POST"> <http:body media-type="application/json">{$body}</http:body> </http:request>
[2]
let $body := <json type="object"/>
return
<http:request href="url" method="POST"> <http:body media-type="application/json">{$body}</http:body> </http:request>