Resources
Adds support for type-safe requests using ResourcesCore.
Example:
@Resource("/users")
class Users {
@Resource("/{id}")
class ById(val parent: Users = Users(), val id: Long)
@Resource("/add")
class Add(val parent: Users = Users(), val name: String)
}
// client-side
val newUserId = client.post(Users.Add("new_user")) // "/users?name=new_user"
val addedUser = client.get(Users.ById(newUserId)) // "/user/123"
Content copied to clipboard