On another topic, what’s the best way to handle “n...
# squarelibraries
b
On another topic, what’s the best way to handle “next page” URLs from the server using retrofit? Is it best to just have another service endpoint that you provide it the “next page” URI and it will send off? For example,
Copy code
interface UserService {
    @GET("/users")
    Call<List<User>> getAll()
 
    @GET("{nextPathAndQuery}")
    Call<List<User>> getNextPage(@Path("nextPathAndQuery") pathAndQuery: String)
}
t
that is how I always do it. some of the github api's will preload the next page so your page call is super fast iirc