# URL Path Parameters

**Content-Type Requested:&#x20;*****\****

```go
// Register the route...
app.Get("/{name}/{age:int}/{tail:path}", handler)

func handler(ctx iris.Context) {
    params := ctx.Params()

    name   := params.Get("name")
    age    := params.GetIntDefault("age", 18)
    tail   := strings.Split(params.Get("tail"), "/")
}
```

## Bind

The `Context.ReadParams(ptr interface{}) error` is the method which binds URL Dynamic Path Parameters from client request to a custom value.

Let's create our Go structure.

```go
type myParams struct {
	Name string   `param:"name"`
	Age  int      `param:"age"`
	Tail []string `param:"tail"`
}
```

Now, the handler which reads the URL and binds to a "myParams" value.

```go
func handler(ctx iris.Context) {
    var p myParams
    if err := ctx.ReadParams(&p); err != nil {
        ctx.StopWithError(iris.StatusInternalServerError, err)
        return
    }
}
```

**Request**

```sh
http://localhost:8080/kataras/27/iris/web/framework
```

**Result**

```go
myParams{
    Name: "kataras",
    Age:  27,
    Tail: []string{"iris", "web", "framework"},
}
```


---

# Agent Instructions: 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://iris-go.gitbook.io/iris/requests/url-path-params.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.
