Describe the issue
Passing Uint8Array or Buffer to postForm results in "source.on is not a function" exception.
Example Code
const data = Uint8Array.from([1, 2, 3])
axios.postForm('http://some.url', { data })
// or
const data = Uint8Array.from([1, 2, 3])
axios.postForm('http://some.url', { data: Buffer.from(data) })
Expected behavior, if applicable
axios should POST a field "data" with the content of the Uint8Array / Buffer
Environment
- Axios Version 0.27.2
- Node.js Version 18.2.0
- OS: Windows 11
Additional context/Screenshots
Code is compiled from TypeScript using typescript 4.6.4 and a tsconfig.json that extends @tsconfig/node18/tsconfig.json
I am trying to upload the PDF output of puppeteer.
What am I doing wrong?