Passing payload into http node

Hello

I have an API for my air con system. I can turn the system on using

http://ip_address/setAircon?json={"ac1":{"info":{"state":"on"}}}

I have tried to use a http request node as follows:
http://ip_address/setAircon?json={{{payload}}}

And injecting a payload of msg.payload = { "ac1": { "info": { "state": "on" } } };

But I am getting the following error from the API:

reason: "Failed to parse message"

request: "setAircon"

Am I doing this correctly?

that creates an object.

try sending actual JSON (string)

msg.payload = JSON.stringify({ "ac1": { "info": { "state": "on" } } })

Legend! Thanks!

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