Upload image to an API as binary data


I need to send the image as binary data to an external API as shown in the screenshot. It works fine with Postman. But, I’m having trouble implementing this in Ionic. I tried reading the file contents as binary data using readAsBinaryString() and passing the result as body of the HTTP request. It didn’t work. Please help with the code sample.

please let me know if you find a solution to this

I have no idea what OP’s image is talking about, but the answer to this question is highly dependent on the format that the backend is expecting. It is perfectly possible to upload binary data using multipart form encoding.