# Passing payload into http node

**URL:** <https://discourse.nodered.org/t/passing-payload-into-http-node/84246>\
**Category:** General\
**Created:** [3 January 2024 09:51 UTC](https://discourse.nodered.org/t/passing-payload-into-http-node/84246 "2024-01-03T09:51:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [3 January 2024 09:51 UTC](https://discourse.nodered.org/t/passing-payload-into-http-node/84246/1 "2024-01-03T09:51:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 January 2024 10:13 UTC](https://discourse.nodered.org/t/passing-payload-into-http-node/84246/2 "2024-01-03T10:13:01Z")

</div>

> [@Sirhc](#):
>
> And injecting a payload of msg.payload = { "ac1": { "info": { "state": "on" } } }

that creates an object.

try sending actual JSON (string)

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

```

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [3 January 2024 10:14 UTC](https://discourse.nodered.org/t/passing-payload-into-http-node/84246/3 "2024-01-03T10:14:19Z")

</div>

> [@Steve-Mcl](#):
>
> `JSON.stringify({ "ac1": { "info": { "state": "on" } } })`

Legend! Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [17 January 2024 10:14 UTC](https://discourse.nodered.org/t/passing-payload-into-http-node/84246/4 "2024-01-17T10:14:27Z")

</div>

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