# HTTP in handling JSON Object via POST

**URL:** <https://discourse.nodered.org/t/http-in-handling-json-object-via-post/453>\
**Category:** General\
**Created:** [28 May 2018 20:11 UTC](https://discourse.nodered.org/t/http-in-handling-json-object-via-post/453 "2018-05-28T20:11:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RubberChicken](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@RubberChicken](https://discourse.nodered.org/u/RubberChicken)\
**Post date:** [28 May 2018 20:11 UTC](https://discourse.nodered.org/t/http-in-handling-json-object-via-post/453/1 "2018-05-28T20:11:31Z")

</div>

Hi,

I have been using the http request node to get JSON data from solar inverters which works fine and returns an object as can be seen here:

(ok, seems I can only post one image)

I now want to use the http in node to receive POST data pushed from the inverters, however the data in the object is not accessible. I have spent about 6 hours trying everything that I can think of in node-red to access this data but no success.

Here is the flow and what I get when set to object and string. It seems the object that is returned contains the object that I am interested in but wrapped in something else?

http in -\> JSON -\> http endpoint

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/f46f2ad627cb83eab915f4badb600afaaf5d9a0d.png)

Any advice on what I am doing wrong here would be appreciated.

Cheers,

RC

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [28 May 2018 20:37 UTC](https://discourse.nodered.org/t/http-in-handling-json-object-via-post/453/2 "2018-05-28T20:37:31Z")

</div>

Hi,

your payload there is an object with a single key/value. The key is the JSON encoded javascript object containing your actual data. Very weird.

To access it, you’d need to do something like this:

```auto
var keys = Object.keys(msg.payload);
msg.payload = JSON.parse(keys[0]);
return msg;

```

But I’d also investigate quite how your data is getting into that form to begin with.

---

<div class="post-metadata">

**Author:** ![RubberChicken](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@RubberChicken](https://discourse.nodered.org/u/RubberChicken)\
**Post date:** [28 May 2018 20:48 UTC](https://discourse.nodered.org/t/http-in-handling-json-object-via-post/453/3 "2018-05-28T20:48:29Z")

</div>

Thank you Nick!

I figured it was something like that and tried parsing but clearly incorrectly.

Unfortunately I don’t have any control over what the inverter POSTS but it is strange that the result is different between a GET and a POST.

Cheers,

RC
