Hello Christian, I'm sorry but I've tried to follow your suggestion rewriting the code as
let $f := file:write-binary("/tmp/" || $name, $map) let $response := http:send-request( <http:request method="POST">, <http:body media-type="image/png"/> </http:request>, $url, $body )
The file that is written to disk is correctly encoded as PNG whereas I continue to get the data base64 encoded on the backend. If it helps I may add that I replaced the backend service with an "nc" and the data arrives there base64 encoded so my issue has to be on the sender side as you correctly suspect. But where? :( Thanks again, Marco.
On 11/08/2016 11:46, Christian GrĂ¼n wrote:
Hi Marco,
If you specify the binary data inside the body element, it will already be converted to a textual representation by the BaseX client. Try this instead:
http:send-request( <http:request method="POST">, <http:body media-type="image/png"/> </http:request>, $url, $data )
Cheers Christian