Sending Object in http node

hello, I am using self hosted n8n version… 0.198.-debian

I am trying to send object in http post. In the preview , it show the object values, however, when i try to send to webhook.site for testing, the body shows [object object ] instead of the object values.
setting before executing.

receiving at webhook.site.

Hi @Benjamin123, you’re probably sending a string here rather than an actual object. When you mix plain text with an expression (so something like foo bar {{ $expression }} baz), any object returned by the expression will be converted to a string, with [object Object] being the string representation of an object.

So, what you want to do here is use an expression only and no plain text around it (not even white spaces). Here’s an example workflow first fetching an example dataset and then passing it on in a new field:

Result:

Note that I’ve created this workflow using the latest n8n version, so you might need to upgrade your own n8n version if the nodes don’t show up on your instance.

hello @MutedJam thanks for your assistance.However, i would like to send a json as following.

with red color box area will be variable ( depends on previous node ).

Hi @Benjamin123, it seems to me that’s pretty much what my example would do. It simply sends a different object in a field called foo rather than inside a field called valueRange. So, you could just change the field name in the HTTP Request node (and of course have it reference your actual data rather than my example data).

@MutedJam after studying your workflow, i add in some more node and it works like a charm… :smile:

1 Like

Awesome, thanks for confirming!

1 Like