1

Similar to Send file+parameters in post request post I am trying to submit a file to an HTML form using Node.js.

I am currently trying to use the http-post package however my code is currently executing without any errors but without submitting the form properly.

var http = require('http');
http.post = require('http-post');

var files = {
    param: "file",
    path: "<filepath>",
    Headers: 'update=<filename>'
};

http.get('http://192.168.84.22/update');

http.post('http://192.168.84.22/update', 'update=<filename>', files, function(res){});

I have captured the HTTP request that I am trying to recreate programmatically from when I have manually submitted the file:

Desired HTTP Request

hong4rc
  • 3,999
  • 4
  • 21
  • 40

0 Answers0