To make a HTTP request with a custom binary body in JavaScript, you can use either the XMLHttpRequest (XHR) object or the newer Fetch API. Here's how you can do it with both approaches:
Using XMLHttpRequest (XHR):
index.tsx609 chars17 linesUsing Fetch:
index.tsx520 chars20 linesIn both cases, replace url with your own API URL and binaryData with your own binary data.
gistlibby LogSnag