Custom Post req node with parameters

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.


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

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.

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