HTTP Request node returns error no valid JSON error even the content is Valid JSON.
ERROR: The data in “Body Parameters” is no valid JSON. Set Body Content Type to “RAW/Custom” for XML or other types of payloads
I have trying to resolve the error in many ways but all are return the same error. Sometimes the HTTP request node executed successfully.
I have tried with
execute node the same JSON content updated successfully.
Information on your n8n setup
**n8n version: n8nio/n8n:0.200.1
**Database you’re using (default: SQLite):Postgres
**Running n8n with the execution process [own(default), main]:default
**Running n8n via [Docker, npm, n8n.cloud, desktop app]:Docker
@MutedJam @Jon Can you help me to come out from the issue? Trying to fix this issue but at last became blind.
I’m not sure what I’m doing wrong. Because sometimes the same HTTP request node working with same node.
February 27, 2023, 10:57am
Oddly enough it appears to work for me, Can you try updating n8n and see if that works for you?
I have updated n8n docker version to 0.217.1. But still facing the same kind of issue. Please check below are the my json structure, which I’m trying send in body parameter.
"lastKnownData": <Stringified JSON>
Can you share the correct request which is working from your end?
February 27, 2023, 12:14pm
I copied your node and sent the request to webhook.site and it worked, The workflow I ran is below. Is it possible that you are not using the same node that you shared with us?
I’m using the same node in my workflow. Which I shared.
@Jon I have tried with simple JSON content
I’m getting the same error with HTTP request node. Also sometimes getting the error like
"connect ECONNREFUSED ::1:80",
If I try with
execute node, It’s working correctly.
February 27, 2023, 2:27pm
Annoyingly I am not able to reproduce it and everything looks fine, The second error with the
ECONNREFUSED message looks to be a network issue where the connection on port 80 is being refused.
Can you try the workflow I shared to see if that works for you?
@Jon We didn’t get any positive solution for the issue. So, we have decided to upload the large amount json as a file to api.
Do you have the exact payload from the HTTP node for a request that fails? (You can see it in the developer console if it’s a manual execution).
The HTTP node has some functionality that escapes the JSON in the body if it detects that it will be invalid JSON. Unfortunately it’s a little overeager sometimes and will start doing this if the contents contains things like an apostrophe (
'). We’re working on fixing this.
The actual issue I was facing in the HTTP node is that when I try to send small json data it passes. But when I try to send big json data it fails.
For example :
Last two days customer data → passes
Last three months customer data → fails
So, I thought the node itself cropping the json data when its too big and I implemented file upload concept. Now I’m uploading the data as json file.
However I’ll check the payload as you said. If its the problem of ( ’ ) I’ll let you know here.