> For the complete documentation index, see [llms.txt](https://tekos.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tekos.gitbook.io/doc/building-apps-1/building-apps/http-and-rest-connections/handle-url-parameters-in-an-http-endpoint.md).

# Handle url parameters in an HTTP endpoint

#### Problem <a href="#problem" id="problem"></a>

You want to create a single HTTP endpoint that can handle requests where parts of the path are set per-request.

For example, a single endpoint that can handle requests to both:

```javascript
http://example.com/hello-param/Nick
http://example.com/hello-param/Dave
```

#### Solution <a href="#solution" id="solution"></a>

Use named path parameters in your `HTTP In` node’s `URL` property and then access the specific value provided in a request using the `msg.req.params` property of the message.

**Flow**

![](/files/-MRUhOof-4EtkmAoqNlU)

**Example**

```markup
[~]$ curl http://localhost:1880/hello-param/Nick
<html>
    <head></head>
    <body>
        <h1>Hello Nick!</h1>
    </body>
</html>
```

#### Discussion <a href="#discussion" id="discussion"></a>

Named path parameters in the `URL` property can be used to identify parts of the path that can vary between requests.

The `msg.req.params` property is an object of key/value pairs for each path parameter.

In the above example, the node is configured with a URL of `/hello-params/:name`, so a request to `/hello-param/Nick` results in the `msg.req.params` property containing:

```javascript
{
    "name": "Nick"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tekos.gitbook.io/doc/building-apps-1/building-apps/http-and-rest-connections/handle-url-parameters-in-an-http-endpoint.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
