[How do i...] add this in a post request HTTP node

I’m needing to add an array to a post request

Not sure the best way to add these into the value correctly.
[ { “ip”: { “ip”: “8.8.8.8/32” } }]

I feel I should know this, but my mind is blank. (don’t want to change it to a RAW post if I can help it)

Hi @RedPacketSec, the example you have provided would be converted to a String when sending the request. To send a JSON object as the body you’d need the JSON/RAW Parameter option indeed.

I was hoping i didnt have to do that :frowning:

that’s annoying, but thanks for the confirmation

Can you try also setting an expression in the Value field? For example: {{[{ "ip": { "ip": "8.8.8.8/32" } }]}}

i’ll give it another go when back at pc

ok so what i asked was solved and works great, but now you have unlocked level 2 :wink:

is this possible, getting the SSH stdout where 8.8.8.8 should be and keep it an array, so far I’ve managed to replicate the format but its not an array, I keep breaking it

Do you have that value saved in a variable?

Out of interest when setting your object there did you try using the set node and using ip.ip then when sending just use { { {{$node["Set"].json}} } }

That would then in theory give you the same json you are sending.

yes i used the set node, no, i didnt try ip.ip :wink: will give it a try

I only found out about that little trick the other day.

So what you could do is use a function item node and just do $node["Set"].json["ip"]["ip"] = $node["SSH"].json["stdout"];

Then next time you use $node["Set"].json it will have the ip set to your return result. It is not pretty but the example below shows it in action.

Example Workflow

nice will give it a try when I get a few mins spare to pop back and play with my n8n stuff, cheers