matteofigus / api-benchmark

A node.js tool to benchmark APIs
MIT License
311 stars 35 forks source link

Send binary-data #129

Closed TheGodMother25 closed 4 years ago

TheGodMother25 commented 4 years ago

I have got a use case where I have to send zip file as a binary data (like in curl --data-binary '@input.zip') Is there a way to handle such requests?

TheGodMother25 commented 4 years ago

Using the content-type and setting the data as below solves the issue; {headers: { 'Content-Type': 'application/octect-stream', 'Accept': 'text/plain,application/octect-stream,*/*' }, data: d }