Trying to upload a file to an HTTP endpoint

I have the request that has to be made which I am able to make from Postman but am unsuccessful in doing from HTTP node.

I looked at this and was trying to send it as binary:
Webhook to HTTP request but was unsuccessful. I am getting an error that the endpoint isn’t getting any file from the request.

curl --location --request POST '' \
--header 'Authorization: something' \
--form '[email protected]"record.csv"' \
--form 'user_email="[email protected]"' \
--form 'recipe_slug="recipe_slug_test"'

I am using Binary > data from the HTTP node after downloading the file.


I think I might be missing something really small.


When using multipart/form-data in the HTTP Node you can just send either binary data or key-value pairs in the body. Does the API allow you to upload the file first and later update the record with the user_email and recipe_slug ?

If so, then you can update the file first by setting up the HTTP node as follow:

and then, with the Record ID, you can make probably a PUT with the user_email and recipe_slug in the body.

Unfortunately, it doesn’t allow for that. I will write a function node to do so and see if I can access the internet from the function node.

Do you think there might be workaround possible for this? We are moving away from Zapier and this is a blocker for a few scenarios.

ah yes, you can use a function node and make the HTTP Request from there. This works as long as you are self-hosting.

Set the env variable export NODE_FUNCTION_ALLOW_BUILTIN=request-promise-native

then in the function node, require the request module and made the HTTP Request using multipart/form-data. If you need help with the function node let me know.

You can check the post below as well.

I tried using axios with export and getting this error:

Is this not the correct way of using export in the function node?

@Veer_Manhas The export option needs to be set via CLI (in npm based setup) or .env file (in Docker based setup), after installation of the node modules, appropriately, that need to be exported.



Thanks! This helps. Very new to n8n.