# Http endpoint accept only the first url parameter

**URL:** <https://discourse.nodered.org/t/http-endpoint-accept-only-the-first-url-parameter/87869>\
**Category:** General\
**Tags:** http-in\
**Created:** [10 May 2024 18:59 UTC](https://discourse.nodered.org/t/http-endpoint-accept-only-the-first-url-parameter/87869 "2024-05-10T18:59:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![colletda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colletda/32/90849_2.png) [@colletda](https://discourse.nodered.org/u/colletda)\
**Post date:** [10 May 2024 18:59 UTC](https://discourse.nodered.org/t/http-endpoint-accept-only-the-first-url-parameter/87869/1 "2024-05-10T18:59:26Z")

</div>

Hi community  
I'm new to node-red and try to config a simple http endpoint (REST API). I startet adapt with the samples from the cookbook: this one with one single parameter works fine ([https://cookbook.nodered.org/http/handle-url-parameters](https://cookbook.nodered.org/http/handle-url-parameters)). Now i wanted to pass 2 or more parameters. So I try to adapt [this example](https://cookbook.nodered.org/http/handle-query-parameters).

But in my case it only accepts the first parameter:

api.mydomain.cloud/api/cm/v1/getdoglistbysearch?clientid=1234&query=test  
api.mydomain.cloud/api/cm/v1/getdoglistbysearch?query=test&clientid=1234

I read the values with msg.req.query.query and msg.req.query.clientid

Do i have adapt the example wrong with 2 or more parameters?  
Daniel

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [10 May 2024 20:29 UTC](https://discourse.nodered.org/t/http-endpoint-accept-only-the-first-url-parameter/87869/2 "2024-05-10T20:29:20Z")

</div>

The example from the link you shared works fine for me  
Can you share your flow ?

This is the test flow i used making a request to `https://<NR_IP>:1880/hello?clientid=1234&query=test`

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ffe9114d35006969d3f1f23368a8229da82c93ee.png)

```auto
[{"id":"b34dd1af.4cb23","type":"template","z":"54efb553244c241f","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head></head>\n <body>\n <h1>{{req.query.clientid}}</h1>\n <h1>{{req.query.query}}</h1>\n </body>\n</html>","x":450,"y":3160,"wires":[["b828f6a6.47d708","de991bfdb1b2b39d"]]},{"id":"1052941d.efad6c","type":"http in","z":"54efb553244c241f","name":"","url":"/hello","method":"get","upload":false,"swaggerDoc":"","x":300,"y":3160,"wires":[["b34dd1af.4cb23"]]},{"id":"b828f6a6.47d708","type":"http response","z":"54efb553244c241f","name":"","statusCode":"","headers":{},"x":630,"y":3160,"wires":[]},{"id":"de991bfdb1b2b39d","type":"debug","z":"54efb553244c241f","name":"debug 76","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"req.query","targetType":"msg","statusVal":"","statusType":"auto","x":590,"y":3220,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![colletda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colletda/32/90849_2.png) [@colletda](https://discourse.nodered.org/u/colletda)\
**Post date:** [11 May 2024 09:34 UTC](https://discourse.nodered.org/t/http-endpoint-accept-only-the-first-url-parameter/87869/3 "2024-05-11T09:34:22Z")

</div>

Thanks for the food for thought. I went through all the nodes again and found the error in the two switch nodes that check the validity of the parameters. I can now read the parameters correctly with rec.query.parametername. And it works.

---

<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:** [25 May 2024 09:35 UTC](https://discourse.nodered.org/t/http-endpoint-accept-only-the-first-url-parameter/87869/4 "2024-05-25T09:35:08Z")

</div>

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