Update
I can avoid the error error: invalid JSON, only supports object and array Error: invalid JSON, only supports object and array if I use the content type application/msgpack instead of application/json for the POST request.
Unfortunately I get a different error now:
error: Cannot read properties of undefined (reading 'data')
TypeError: Cannot read properties of undefined (reading 'data')