0

I'm writing a node SDK and one of the endpoints allows for a file_upload parameter. I'm currently using the standard https library to make my calls, and I wonder if I should continue using it or move to something the "requests" library given that I need to do file uploads.

Here is an article I was reading through to build multi-part file upload functionality into the https module, but the article doesn't say the best way to combine the multi-part file form data and additional parameters say "test_mode=true" or something like that.

how to upload a file from node.js

Wondering if I should move over to requests complete or if this approach seems good then how can I add the above multi-part form functionality but extend it to allow for additional parameters in the body as well as a file binary.

Community
  • 1
  • 1
asolberg
  • 6,638
  • 9
  • 33
  • 46

1 Answers1

0

The request module uses the form-data module for sending multipart/form-data requests. You could also use form-data by itself if you don't want to use request.

mscdex
  • 104,356
  • 15
  • 192
  • 153