How to put a file in http request

I have this curl command that I would like to have in node red

curl -X 'POST'
'https://api.server.com/processing/myfunction?include=opt1&include=opt2&wait_for=120'
-H 'accept: application/json'
-H 'Content-Type: multipart/form-data'
-F 'file=test.jpg;type=image/jpeg'
-F 'parameters={
"language": "en"
}'

I used POSTMAN to convert it
And the in NodeRed I used the Change Node

Set msg.heardes = {
"accept": "application/json"
}

Set msg.url = https://api.server.com/processing/myfunction?include=opt1&include=opt2&wait_for=120'

but how to do multipart/form-data?
According to the api documentation
file is a string($binary)
parameters is an object : { "language": "en" }

How I can I upload or use local file to convert to binary and also how to pass this in the body.
ps: I am a beginner :slight_smile:

If you have somme example....

Here are some threads that should get you moving...

https://discourse.nodered.org/search?q=multipart%2Fform-data

Here is a complete example...
https://flows.nodered.org/flow/cbf44e064b9406a1175a7e8d589f66ac

and here is a bunch of (potential) contrib nodes that may work...
https://flows.nodered.org/search?term=multipart

thanks you
I will have a look

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.