# Help understanding http in output

**URL:** <https://discourse.nodered.org/t/help-understanding-http-in-output/52320>\
**Category:** General\
**Created:** [17 October 2021 10:25 UTC](https://discourse.nodered.org/t/help-understanding-http-in-output/52320 "2021-10-17T10:25:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![spoopy](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@spoopy](https://discourse.nodered.org/u/spoopy)\
**Post date:** [17 October 2021 10:25 UTC](https://discourse.nodered.org/t/help-understanding-http-in-output/52320/1 "2021-10-17T10:25:27Z")

</div>

Hello, new to node red and struggling to understanding how to to deal with the output of a webhook posting to an http in node

The payload comes out as a buffer which when converted to a string looks like:

--931efb49-f7ca-417a-b8cf-1bf35a8922ea  
Content-Type: application/json; charset=utf-8  
Content-Disposition: form-data; name=data

{some JSON content}  
--931efb49-f7ca-417a-b8cf-1bf35a8922ea--

Feeding this into a parse JSON node either gets me "Ignored non-object payload" if I do it directly, or "Unexpected number in JSON at position 1" if I convert the payload to a string first

Am I missing something obvious or does anyone have any advice?

Many thanks for any help

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [17 October 2021 10:32 UTC](https://discourse.nodered.org/t/help-understanding-http-in-output/52320/2 "2021-10-17T10:32:19Z")

</div>

Where does the data come from, do you generate this yourself ?

---

<div class="post-metadata">

**Author:** ![spoopy](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@spoopy](https://discourse.nodered.org/u/spoopy)\
**Post date:** [17 October 2021 10:32 UTC](https://discourse.nodered.org/t/help-understanding-http-in-output/52320/3 "2021-10-17T10:32:58Z")

</div>

Unfortunately not, I don't have control over the original output

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [17 October 2021 10:57 UTC](https://discourse.nodered.org/t/help-understanding-http-in-output/52320/4 "2021-10-17T10:57:39Z")

</div>

> [@spoopy](#):
>
> Feeding this into a parse JSON node either gets me "Ignored non-object payload"

Sure enough the JSON node won´t handle this kind of text. You will need to use a specialized parser for `content-disposition` response. There are a few on [NPM](https://www.npmjs.com/search?q=content-disposition), search for `content-disposition`. Probably it will be easier to use a NPM module instead of creating your own. [Some reference.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type)

---

<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:** [17 October 2021 11:15 UTC](https://discourse.nodered.org/t/help-understanding-http-in-output/52320/5 "2021-10-17T11:15:05Z")

</div>

If you tick the 'allow file upload' option in the HTTP In node, it should do all the parsing for you.

---

<div class="post-metadata">

**Author:** ![spoopy](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@spoopy](https://discourse.nodered.org/u/spoopy)\
**Post date:** [17 October 2021 11:40 UTC](https://discourse.nodered.org/t/help-understanding-http-in-output/52320/6 "2021-10-17T11:40:05Z")

</div>

Thanks knolleary, that did the trick

The actual JSON payload itself is fairly standard - Just for my own (idiot's) understanding, is the content-disposition header in there effectively saying 'the content is something that needs to be downloaded', hence needing the file upload box ticked on the node? Is this pretty standard or a case of the headers being a bit wonky at the source in this particular case?

---

<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:** [31 October 2021 11:41 UTC](https://discourse.nodered.org/t/help-understanding-http-in-output/52320/7 "2021-10-31T11:41:01Z")

</div>

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