-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EDIT] Support POSTing binary data to another API using gaxios #348
Comments
I have the same question. Two years in development and no answer :/ No idea how to send files using gaxios. |
I'm updated this to reflect the fact that we don't support this functionality today, and should potentially consider adding this feature as an improvement to the library. |
I might have misunderstood the issue, but I got it working ok for me. I used: ...
data: fs.createReadStream(filename),
headers: {
'Content-Type' : 'application/octet-stream'
}
... as explained in the README file (see f844222) |
Manually setting the headers['Content-Type'] = 'application/octet-stream'; We will improve this in the next major: |
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 toBuffer
, that external service throwsmedia 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.
When I used this, I got the below WARN.
The text was updated successfully, but these errors were encountered: