# Custom Post req node with parameters

**URL:** <https://discourse.nodered.org/t/custom-post-req-node-with-parameters/44524>\
**Category:** Developing Nodes\
**Created:** [22 April 2021 07:43 UTC](https://discourse.nodered.org/t/custom-post-req-node-with-parameters/44524 "2021-04-22T07:43:52Z")\
**Posts on this page:** 3\
**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:** [22 April 2021 07:43 UTC](https://discourse.nodered.org/t/custom-post-req-node-with-parameters/44524/1 "2021-04-22T07:43:52Z")

</div>

Hello,  
Im creating a custom Http Post node that if given right parameters it gives back an certain value. Using postman everything works fine. This is probably not a thing for a node red forum but i didnt get any answer on other forums so I want to try here.

 ![Untitled](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/c/2c8928bf9375d24f812ec636f539caf77fa01a5e.png)  
This is in postman . I need to get the result in javascript but dont know how to give those parameters.  
Tried like this but it says bad request or unsupported media type :

` const otherParams = { headers: { "content-type": "application/json; charset=UTF-8" }, body: { name: "Drugi" }, method: "POST", }; fetch(url, otherParams) .then((data) => console.log(data.json())) .then((res) => console.log(res));`

Dont know why the code is formatted like this

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 April 2021 08:31 UTC](https://discourse.nodered.org/t/custom-post-req-node-with-parameters/44524/2 "2021-04-22T08:31:20Z")

</div>

The headers need to be in msg.headers and the body in msg.payload, you then send that msg to the http-request node having set that node to do a POST to the url you need.

---

<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:** [21 June 2021 08:31 UTC](https://discourse.nodered.org/t/custom-post-req-node-with-parameters/44524/3 "2021-06-21T08:31:43Z")

</div>

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