Handle different http requests with only one http request node?


I'm (still) quite new with Node-RED (but already very enthusiastic ;-).
I have to send very different http requests to an web API:

  • All http request will have the same request header, namely the actual access token


  • Some request need a GET method, with a specific URL / Endpoint)

  • Some request need a POST method, with a specific URL / endoint AND a specific request body

Does each single request need it's own http-request node, or can I (somehow) inject different headers, methods and URLs into only one, single http-request node?

Kind regards

If you read the help text (select node and use help tab in sidebar) for the http request node
you can specify

  • method with msg.method get,post etc
  • url with msg.url you can set the get query string here to for get requests
  • headers with msg.headers an object of headers

So you can just use one request node if you wish. You have to select set by msg.method in the method input field of the request node.

1 Like


Thank you very much.
I have read the node help, but I didn't understand, that all mentioned inputs can be used with the msg. - object. I'm still a rookie. :-/

But now, I can go forward.

Kind regards