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
Error with "getBuffer()" #439
Comments
https://github.com/form-data/form-data/blob/master/lib/form_data.js#L328 The stream can not be converted to buffer just use So is this a bug? @JBtje A example of RunKit: https://runkit.com/embed/185tn66ybn8p |
If you use Example with readFileSync: Note: does not take away that the example is wrong :| |
-Fixed: Eerror in the documentations as indicated in #439
Thx all for the help. Will give it another try ASAP ! |
Okay. But how to set content type? Current value is |
I'm unsure what you mean... A e.g. if I have the string "HELLO WORLD", then the buffer will contain |
@JBtje, yeah, I am able to understand what you mean. Receiving as Is there anyway, to set the data in FormData along with the content type, as exactly same way it happens with web browsers? I am using FormData in my test cases to make upload requests for tests. Currently, for now, I added a work around in the server code to check the NODE_ENV & set the content type manually. |
I tried to use the getBuffer function detail here
https://github.com/form-data/form-data#buffer-getbuffer
to get my from as buffer for axios but i end up with an error. I tried to reproduce with the smallest possible code (the issue is when the getBuffer method is call):
I have the following error when calling this code
I tried to debug without success and had a look on the existing ticket and only found this one that is related to this function and type #427 but it seems already closed.
I wonder if i miss something or if there a real issue there. any advice to debug would be welcome.
The text was updated successfully, but these errors were encountered: