# HTTP: Exact Routing

**URL:** <https://discourse.julialang.org/t/http-exact-routing/47912>\
**Category:** General Usage\
**Created:** [October 7, 2020, 4:18am UTC](https://discourse.julialang.org/t/http-exact-routing/47912 "2020-10-07T04:18:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jea/32/18457_2.png) [@Jea](https://discourse.julialang.org/u/Jea)\
**Post date:** [October 7, 2020, 4:18am UTC](https://discourse.julialang.org/t/http-exact-routing/47912/1 "2020-10-07T04:18:15Z")

</div>

I want to make an exact router for example.

```julia
HTTP.@register(Router, "GET", "/hello", myFunction)

```

If for example the url is **/hello/any** , not respond with the as **/hello**

this without declare the route: **/hello/any**

---

<div class="post-metadata">

**Author:** ![zgornel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zgornel/32/217487_2.png) [@zgornel](https://discourse.julialang.org/u/zgornel)\
**Post date:** [October 7, 2020, 11:04am UTC](https://discourse.julialang.org/t/http-exact-routing/47912/2 "2020-10-07T11:04:59Z")

</div>

Perhaps declaring an additional router for `/hello/*` with a dummy handler may do it…

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [October 7, 2020, 1:16pm UTC](https://discourse.julialang.org/t/http-exact-routing/47912/3 "2020-10-07T13:16:56Z")

</div>

Seems like a reasonable feature request to HTTP.jl to support exact matching, perhaps using regexes like this:

```julia
HTTP.@register(Router, "GET", r"/hello$", myfunction)

```

---

<div class="post-metadata">

**Author:** ![Jea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jea/32/18457_2.png) [@Jea](https://discourse.julialang.org/u/Jea)\
**Post date:** [October 7, 2020, 6:43pm UTC](https://discourse.julialang.org/t/http-exact-routing/47912/4 "2020-10-07T18:43:40Z")

</div>

When i try

```julia
HTTP.@register(Router, "GET", r"/hello$", myfunction)

```

I get this error

```julia
ERROR: LoadError: MethodError: no method matching split(::Regex, ::Char; keepempty=false) 

```

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [October 7, 2020, 6:53pm UTC](https://discourse.julialang.org/t/http-exact-routing/47912/5 "2020-10-07T18:53:09Z")

</div>

Yes it doesn’t work; it was just a potential way to implement it in HTTP.

---

<div class="post-metadata">

**Author:** ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Post date:** [October 7, 2020, 7:04pm UTC](https://discourse.julialang.org/t/http-exact-routing/47912/6 "2020-10-07T19:04:27Z")

</div>

@quinnj, open an issue for the feature request?
