it seems that when passing a Buffer in const options = { data: Buffer.from('foo') }, centra would handle it as json since typeof Buffer resolves to object.
I see two solutions here:
default sendAs to 'raw', which would become a breaking change (since currently 'json' is assumed
add options.buffer and leave options.data as is. When options.buffer is used, call req.body(options.buffer, 'raw')
Thoughts? Happy to provide PR after discussion about suggested options
it seems that when passing a
Buffer
inconst options = { data: Buffer.from('foo') }
,centra
would handle it asjson
sincetypeof Buffer
resolves toobject
. I see two solutions here:sendAs
to'raw'
, which would become a breaking change (since currently'json'
is assumedoptions.buffer
and leaveoptions.data
as is. Whenoptions.buffer
is used, callreq.body(options.buffer, 'raw')
Thoughts? Happy to provide PR after discussion about suggested options