Computer scienceProgramming languagesKotlinAdditional instrumentsAdditional librariesCommunications and Networks

Retrofit

Getting by Id

Report a typo

We are coding our client with Retrofit, we have a function to find a person by id: suspend fun getById(id: Long): Response<PersonDto>. The result is a PersonDto in the endpoint: api/users/{id}. Please complete the code with the annotations to perform the operation.

@GET("api/users/{id}")
suspend fun getById(/*what annotation is needed here*/ id: Long): Response<PersonDto>

Write only annotation with parameter.

Enter a short text
___

Create a free account to access the full topic