How can you use the resource feature to create thi...
# ktor
h
How can you use the resource feature to create this kind of url:
<http://foo.com/foos('myID')|foo.com/foos('myID')>
where
myID
should be a parameter?
Copy code
@Resource("/foo('{id}')")
public data class Foo(val id: String)
Results into
<http://foo.com/foos('%7Bid%7D')?id=bar|foo.com/foos('%7Bid%7D')?id=bar>
a
I don't think the
Resources
plugin allows that. You can solve the problem with the Regex routes.
h
That’s only available on server side, isn’t it? I want to use it from client side.
a
The only option I see is to make a request the old way.
h
Yes, this is my current workaround too.