Hi, I use the Ktor http client in a MP project, I ...
# ktor
j
Hi, I use the Ktor http client in a MP project, I have an api url with a custom part like
"users/{name}/commits"
, is there something in Ktor to handle this ? For the moment I use `"users/{name}/commits".replace("{name}", "Jérôme")`🙃 Retrofit handle it like this :
Copy code
@GET("users/{name}/commits")
Call<List<Commit>> getCommitsByName(@Path("name") String name);
m
You can use string template : “users/$name/commits” where $name is the variable containing Jérôme.
j
Thanks, yep it's nice but it's working only if you have the path IN the method, you can't refer to an extern property to reuse it
m
It’s the same for Retrofit. But I see what you want but I don’t have solution. Perhaps an other lib...