# Custom Http Post Node

**URL:** <https://discourse.nodered.org/t/custom-http-post-node/44384>\
**Category:** Developing Nodes\
**Created:** [19 April 2021 07:15 UTC](https://discourse.nodered.org/t/custom-http-post-node/44384 "2021-04-19T07:15:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jake123](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@jake123](https://discourse.nodered.org/u/jake123)\
**Post date:** [19 April 2021 07:15 UTC](https://discourse.nodered.org/t/custom-http-post-node/44384/1 "2021-04-19T07:15:40Z")

</div>

I want to create a node that has a dropdown of some data. I managed to create such dropdown and now i want to make a post request for each data i select in my Dropdown. How would i do that.

EDIT: Is this good ?

```auto
    RED.nodes.createNode(this,config); 
        this.options = config.options
        this.server = config.server;
        this.port = config.port;
        var node = this;
        node.on('input', function(msg) {
            let options = node.options
            const address = node.server;
            const port = node.port
            const ip = address + port;
            // const url = http://${ip}/${options.text}/value={{{msg.payload}}}
            const url = http://${ip}/${options.text}
            fetch(url, {
                method: 'POST',
                body: JSON.stringify({
                    title: options.text,
                    body: msg.payload
                }),
                headers: {
                    "Content-type": "application/json; charset= UTF-8"
                }
            })
            });

```

Options is my select tag server and port are ip of the server

---

<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:** [18 June 2021 07:16 UTC](https://discourse.nodered.org/t/custom-http-post-node/44384/2 "2021-06-18T07:16:34Z")

</div>

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