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