The data in "Body Parameters" is no valid JSON

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. :frowning:

I’m not sure what I’m doing wrong. Because sometimes the same HTTP request node working with same node.

Hey @Siva_Nagarajan,

Oddly enough it appears to work for me, Can you try updating n8n and see if that works for you?

1 Like

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?

Hey @Siva_Nagarajan,

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

{
"lastKnownState": "123456789010"
}

I’m getting the same error with HTTP request node. Also sometimes getting the error like

"message":
"connect ECONNREFUSED ::1:80",

If I try with execute node, It’s working correctly.

Hey @Siva_Nagarajan,

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.

1 Like

Does that approach work?

1 Like

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.

1 Like

Yes, That’s working.

Hello @sirdavidoff,

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.

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