Skip to content

Instantly share code, notes, and snippets.

@theboreddev
Created Oct 24, 2021
Embed
What would you like to do?
Using custom object
fun findEmployeeByName(name: String): EmployeeResponse {
val request = Request(Method.GET, "http://myservice.org/employees").query("name", name)
val response = client(request)
return EmployeeResponse(Employee(response.bodyString()), response)
}
data class EmployeeResponse(
val result: Employee?,
val response: Response
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment