You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 3, 2026. It is now read-only.
I'm using gaxios NPM library. I've an external service that accepts application/octet-stream as media type. I need to send a binary data from my Node.JS application to this server. How to do this ?. Whenever I try to send a binary data by converting it to Buffer, that external service throws media type application/json is not supported error. I think, gaxios internally serializes body into application/json. Please see my following code snippet.
const bufferData = Buffer.from(jsonObject.data)
I have to send this binary data using gaxios.
publicasyncpostBinaryData(data:Buffer) : Promise<any>{constrequestOptions: GaxiosOptions={};requestOptions.url='http://localhost/api/acceptBinary';// External ServicerequestOptions.method='POST';requestOptions.headers['Content-Type']='application/octet-stream';// Should we add this ? It's not overriding default request mime type.constgaxiosResponse=awaitrequest(requestOptions);}