# Http output from msg.payload

**URL:** https://discourse.nodered.org/t/http-output-from-msg-payload/46617
**Category:** General
**Created:** [2 June 2021 20:40 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617 "2021-06-02T20:40:15Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [2 June 2021 20:40 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617/1 "2021-06-02T20:40:15Z")

</div>

Hallo,  
is it easy possible to get msg.payload from my flows as a http output like this (from my wallbox):

![12](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/e/fe028e3f76efea2ff14061929f195302fe1d5bdf.jpeg)

without installing a webserver or similar 😬

greetings

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [2 June 2021 20:46 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617/2 "2021-06-02T20:46:38Z")

</div>

Yes, a simple example is here  
[https://cookbook.nodered.org/http/create-an-http-endpoint](https://cookbook.nodered.org/http/create-an-http-endpoint)

or if you want to make a request here is another example  
[https://cookbook.nodered.org/http/simple-get-request](https://cookbook.nodered.org/http/simple-get-request)

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [3 June 2021 05:20 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617/3 "2021-06-03T05:20:32Z")

</div>

I already saw this example, but it doesn't help me 😒

How do I get a msg.payload in it ?

```auto
<html>
    <head></head>
    <body>
        <h1>global.SoC</h1>
    </body>
</html>

```

just write "global.SoC"

edit:  
got it with the global:

```auto
<html>
    <head>{{global.SoC}}</head>
</html>

```

can I get msg.payload without global or flow ?

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [3 June 2021 05:54 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617/4 "2021-06-03T05:54:47Z")

</div>

maybe you can explain what is the difference between:

![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/6/a6010915e8c0af06a482fea8c3d51fb11936265c.png)

![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/1/d10834f4592a32e5b4d0fc447721553eacd1e5f8.png)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [3 June 2021 06:14 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617/5 "2021-06-03T06:14:56Z")

</div>

> [@Becker](#):
>
> can I get msg.payload without global or flow ?

To use msg.payload just drop the msg. So {{payload}}

> [@Becker](#):
>
> ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/1/d10834f4592a32e5b4d0fc447721553eacd1e5f8.png)

That is the output so if you want the template as msg.payload, select msg and type payload

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [3 June 2021 11:00 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617/6 "2021-06-03T11:00:21Z")

</div>

thank you.

the device who should read the http doesn´t except the url/value.  
the info says:

> Valid values are full url. The requested url must return a pure number. If the return value contains something other than "-" (for infeed) or "0-9", the value is set to zero. The value must be in watts.

I´m not sure if the http out is a string or a number.

firefox says:  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/95fab62ab13b54f564f748eb8987d4c9b41ba7ac.png)

or is the problem the port (:1880) in the url 🙄

I think the port can not be bypassed =\> url without :1880 ?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [3 June 2021 12:53 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617/7 "2021-06-03T12:53:09Z")

</div>

does not matter as all numbers and strings are sent as strings.

You will need to remove the html from the template and just have {{payload}} in the template no other text

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [3 June 2021 13:48 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617/8 "2021-06-03T13:48:14Z")

</div>

thank you again, now it is accepted

---

<div class="post-metadata">

### Author: ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)
#### Post date: [3 June 2021 17:49 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617/9 "2021-06-03T17:49:17Z")

</div>

last question for today:

![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/a/4ac60605dd94870a564e5388ca37241eeefdee80.png)

the response always has to be empty ?  
I don't understand the point of this node.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [3 June 2021 17:57 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617/10 "2021-06-03T17:57:04Z")

</div>

Not always, some times you need to send headers in the response, or alter the status code, or delete cookies.

The http in node creates a msg.res, which is passed to the response node. This will contain standard response code, headers and other information and the response url.

---

<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: [2 August 2021 17:57 UTC](https://discourse.nodered.org/t/http-output-from-msg-payload/46617/11 "2021-08-02T17:57:39Z")

</div>

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