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.