The is pretty basic JavaScript knowledge - you would do well to learn some JavaScript (especially about objects and JSON - it will help you get to grips with node red as will watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red.
A JS object is created like this...
var myObject = {}; //create an empty object
myObject.myNumberProperty = 123; // add a number property
var theNumber = myObject.myNumberProperty; //how to access a property in an object
So where i said "try making a JS object with your form properties and values as key/value pairs" you would do something like this...
/* working curl...
curl -i -X POST -H “Content-Type: multipart/form-data” -F “upload=@/Users/al/artwork/pacman.gif” -F “upload-type=ANIMATED_GIF” -F “console=MAME” -F “displaynow=1”
*/
//set msg.headers to an {object} with property "Content-Type" set to "multipart/form-data"
msg.headers = {
"Content-Type": "multipart/form-data"
}
//set payload to an {object} with key/values as specified in the curl form data
msg.payload = {
"upload": "@/Users/al/artwork/pacman.gif",
"upload-type": "ANIMATED_GIF",
"console": "MAME",
"displaynow": 1
};
//set url
msg.url = "http://localhost:8080/uploadplatform"
// return the msg to next node (the http request)
return msg;
NOTE: the msg.url
property can be set in the function or in the http request node (read the built in help on the RH side-bar)
Here is a demo flow you can import (untested - as i dont have your endpoint or flow - but it should get you close)
[{"id":"bb7f1af3.ad7df8","type":"function","z":"553814a2.1248ec","name":"","func":"/* working curl...\ncurl -i -X POST -H “Content-Type: multipart/form-data” -F “upload=@/Users/al/artwork/pacman.gif” -F “upload-type=ANIMATED_GIF” -F “console=MAME” -F “displaynow=1”\n*/\n\n//set msg.headers to an {object} with property \"Content-Type\" set to \"multipart/form-data\"\nmsg.headers = {\n \"Content-Type\": \"multipart/form-data\" \n}\n \n//set payload to an {object} with properties and values\nmsg.payload = {\n \"upload\": \"@/Users/al/artwork/pacman.gif\",\n \"upload-type\": \"ANIMATED_GIF\",\n \"console\": \"MAME\",\n \"displaynow\": 1\n}; \n\n//set url\nmsg.url = \"http://localhost:8080/uploadplatform\"\n\n// return the msg to next node (the http request)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1500,"y":1040,"wires":[["2a16909e.64bbf"]]},{"id":"e2e9f5bb.79a668","type":"inject","z":"553814a2.1248ec","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1340,"y":1040,"wires":[["bb7f1af3.ad7df8"]]},{"id":"2a16909e.64bbf","type":"http request","z":"553814a2.1248ec","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":1670,"y":1040,"wires":[["4209b9dd.0c7928"]]},{"id":"4209b9dd.0c7928","type":"debug","z":"553814a2.1248ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1850,"y":1040,"wires":[]}]