How to send json file as the HTTP POST request Form-data

Hello everyone.
I have working CURL request:

curl -X POST -H “Content-Type: multipart/form-data” -H “X-API-Key: [mykey]” -F “[email protected]S-Factoring

This request works fine, I tried to convert it to N8N workflow but no success. I’m getting the error:

ERROR: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined.

Here is my workflow.

N8N Version: 1.17.1
Running n8n via Docker
Operating system Linux

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Radik_Balagutdinov,

Welcome to the community :raised_hands:

It looks like the issue is with the binary data conversion, The key name you were using looked like a filename rather than a key, Try the below workflow which should work.

Thank you @Jon, problem was exactly there :slight_smile: I already found the solution by Javascript code to stringify json to binary but your solution is better because it’s default N8N Node instead of coding.

1 Like

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