Describe the problem/error/question
I am a complete noob, please help me make a post request to an api with a file
What is the error message (if any)?
I’m not getting any error message, i just want to figure out, how to do this, as i’m lost in the other discussions.
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
n8n version:cloud
Database (default: SQLite):
n8n EXECUTIONS_PROCESS setting (default: own, main):
Running n8n via (Docker, npm, n8n cloud, desktop app):
Operating system:
Jon
8 يناير 2024، 2:54م
2
Hey @Harshi ,
Welcome to the community
It all depends on what your API is expecting, One way you can do it is like the below which downloads our logo and posts it to webhook.site in the body.
I suspect @Harshi wants to replicate the HTTP Request in the “Code1” node. That is, it has to include formData parameters.
formData: {
file: {
value: Buffer.from(data, 'base64'),
options: {
filename: binaryData.fileName,
contentType: binaryData.mimeType,
},
},
minimum_severity: 'Info',
active: 'true',
verified: 'true',
scan_type: 'Nessus Scan',
product_name: 'ProductName',
engagement_name: 'EngagementName',
close_old_findings: 'true',
push_to_jira: 'false',
environment: 'Production',
This could be done by extending Jon’s configuration as below (just some of them included for demo purpose)
And the outcome of this configuration