# How to get path params from http post url

**URL:** https://discourse.nodered.org/t/how-to-get-path-params-from-http-post-url/84591
**Category:** General
**Created:** [16 January 2024 06:54 UTC](https://discourse.nodered.org/t/how-to-get-path-params-from-http-post-url/84591 "2024-01-16T06:54:43Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![shershah](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@shershah](https://discourse.nodered.org/u/shershah)
#### Post date: [16 January 2024 06:54 UTC](https://discourse.nodered.org/t/how-to-get-path-params-from-http-post-url/84591/1 "2024-01-16T06:54:43Z")

</div>

Hi,

How to get path params from http post url. e.g. [http://nodered:1880/post/{name}](http://nodered:1880/post/%7Bname%7D). I am trying through

> msg.req.name

but its not working.

---

<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: [16 January 2024 07:48 UTC](https://discourse.nodered.org/t/how-to-get-path-params-from-http-post-url/84591/2 "2024-01-16T07:48:40Z")

</div>

It is not cleare whether you are talking about the http in node or request node. I presume the in node.

From the sidebar help text of the http in node.

> The node will listen on the configured path for requests of a particular type. The path can be fully specified, such as `/user` , or include named parameters that accept any value, such as `/user/:name` . When named parameters are used, their actual value in a request can be accessed under `msg.req.params` .

---

<div class="post-metadata">

### Author: ![shershah](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@shershah](https://discourse.nodered.org/u/shershah)
#### Post date: [17 January 2024 05:08 UTC](https://discourse.nodered.org/t/how-to-get-path-params-from-http-post-url/84591/3 "2024-01-17T05:08:33Z")

</div>

msg.req.params giving undefined error when I am using node.warn()

---

<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: [17 January 2024 05:54 UTC](https://discourse.nodered.org/t/how-to-get-path-params-from-http-post-url/84591/4 "2024-01-17T05:54:26Z")

</div>

And how are you setting the path in the http in node config?  
it should be `/post/:name`

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [17 January 2024 06:56 UTC](https://discourse.nodered.org/t/how-to-get-path-params-from-http-post-url/84591/5 "2024-01-17T06:56:44Z")

</div>

Use a debug node and set it to complete msg output to see what you are actually posting in the params.

---

<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: [17 January 2024 17:14 UTC](https://discourse.nodered.org/t/how-to-get-path-params-from-http-post-url/84591/6 "2024-01-17T17:14:00Z")

</div>

There is an example in the Node-red website Cookbook that you can import and study

[Handle url parameters in an HTTP endpoint](https://cookbook.nodered.org/http/handle-url-parameters)

---

<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: [17 March 2024 17:14 UTC](https://discourse.nodered.org/t/how-to-get-path-params-from-http-post-url/84591/7 "2024-03-17T17:14:34Z")

</div>

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