Hey, I’m trying to send
a POST request via the HTTP node. I got some mock data in a webhook as a starting point. If I manually copy and paste the output from the webhook into the HTTP nodes body it works fine. If I try to map the data via the expression funtion I get an 422 error from the endpoint. I don’t see any different in my data.
I tried the expressions
{{ $node["Webhook"].json["body"] }}
{{ $json["body"] }}
{{ $json }}
and different options with stringify an parse
Describe the issue/error/question
HTTP node works if I manually copy the body from previous node into fixed body of HTTP node but not If I use the expression to do the same
What is the error message (if any)?
ERROR: Your request is invalid or could not be processed by the service
Please share the workflow
(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)
Share the output returned by the last node
{"status":"rejected","reason":{"message":"422 - \"{\\\"message\\\":\\\"The type field is required.\\\",\\\"errors\\\":{\\\"type\\\":[\\\"The type field is required.\\\"]}}\"","name":"Error","stack":"Error: Request failed with status code 422\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (node:events:525:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)"}}
Information on your n8n setup
- n8n version: 0.206.1
- Database you’re using (default: SQLite): SQLite
- Running n8n with the execution process [own(default), main]: own, main
- Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker