The curl command to try and post a JSON file with binary data
curl -X POST -H "Content-Type:application/json;charset=utf-8" -H "Accept: application/json" --data-ascii @filename.json http://localhost:3002/api/xyz -v -s
Gives an error 400
Unexpected token \u0011 in JSON at position 13
It appears the error is because data in json content variable is in binary containing 0x11 which JSON doesn't allow. How to encode it in utf-8 in cURL before sending this.