files/en-us/web/api/request/arraybuffer/index.md
{{APIRef("Fetch API")}}{{AvailableInWorkers}}
The arrayBuffer() method of the {{domxref("Request")}} interface
reads the request body and returns it as a promise that resolves with an {{jsxref("ArrayBuffer")}}.
arrayBuffer()
None.
A promise that resolves with an {{jsxref("ArrayBuffer")}}.
ArrayBuffer (for example, if the data size is too large).const myArray = new Uint8Array(10);
const request = new Request("/myEndpoint", {
method: "POST",
body: myArray,
});
request.arrayBuffer().then((buffer) => {
// do something with the buffer sent in the request
});
{{Specifications}}
{{Compat}}