# Handle different http requests with only one http request node?

**URL:** <https://discourse.nodered.org/t/handle-different-http-requests-with-only-one-http-request-node/89378>\
**Category:** General\
**Created:** [9 July 2024 15:37 UTC](https://discourse.nodered.org/t/handle-different-http-requests-with-only-one-http-request-node/89378 "2024-07-09T15:37:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RK\_aus\_S](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rk_aus_s/32/92170_2.png) [@RK\_aus\_S](https://discourse.nodered.org/u/RK_aus_S)\
**Post date:** [9 July 2024 15:37 UTC](https://discourse.nodered.org/t/handle-different-http-requests-with-only-one-http-request-node/89378/1 "2024-07-09T15:37:09Z")

</div>

Hello

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  
Roman

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [9 July 2024 15:43 UTC](https://discourse.nodered.org/t/handle-different-http-requests-with-only-one-http-request-node/89378/2 "2024-07-09T15:43:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RK\_aus\_S](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rk_aus_s/32/92170_2.png) [@RK\_aus\_S](https://discourse.nodered.org/u/RK_aus_S)\
**Post date:** [9 July 2024 15:53 UTC](https://discourse.nodered.org/t/handle-different-http-requests-with-only-one-http-request-node/89378/4 "2024-07-09T15:53:22Z")

</div>

@E1cid

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  
Roman

---

<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:** [23 July 2024 15:53 UTC](https://discourse.nodered.org/t/handle-different-http-requests-with-only-one-http-request-node/89378/5 "2024-07-23T15:53:40Z")

</div>

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