# HTTP Post with Parameter and Body

**URL:** <https://discourse.nodered.org/t/http-post-with-parameter-and-body/21132>\
**Category:** General\
**Created:** [1 February 2020 11:36 UTC](https://discourse.nodered.org/t/http-post-with-parameter-and-body/21132 "2020-02-01T11:36:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [1 February 2020 12:34 UTC](https://discourse.nodered.org/t/http-post-with-parameter-and-body/21132/2 "2020-02-01T12:34:46Z")

</div>

Try using below code inside a function node. Of course you want to replace the data otherwise the API will not authenticate.

The HTTP request node should have the Method field configured as "-set by msg.method-"

```auto
msg.headers = {}
msg.method = "POST"
msg.url = "https://arche.webuntis.com/WebUntis/jsonrpc.do" ;
msg.headers["content-type"] = "application/json"

msg.payload = {
"id":"ID",
"method":"authenticate",
"params":
{
"user":"xy",
"password":"PASSWORD",
"client":"CLIENT"
},
"jsonrpc":"2.0"
};

return msg

```

---

_[View the full topic](https://discourse.nodered.org/t/http-post-with-parameter-and-body/21132)._
