serviejs / popsicle

Simple HTTP requests for node and the browser
MIT License
246 stars 19 forks source link

Exception 'Unknown body type' sending ArrayBuffer from node.js app #138

Closed NunzioCar closed 4 years ago

NunzioCar commented 4 years ago

With this node code:

`var popsicle = require('popsicle');

const buffer = new ArrayBuffer(8); const uint8 = new Uint8Array(buffer); uint8.set([1, 2, 3], 3);

const res = popsicle.fetch('http://localhost:52128/arraybuffer', { method: 'POST', body: buffer, omitDefaultHeaders: true, headers: {'Content-Type':'application/octet-stream'} }).then((res) => console.log(res));`

we get the 'Unknown body type' exception (tested with node v10.16.0)

Thanks

blakeembrey commented 4 years ago

Thanks for the flag! This has been resolved with the latest release.