pass parameters on a request in the retrofit

0

I'm studying retrofit and I came across the following problem:

I'm performing a get request on the url link

But when I mount the request I can not add the posts / 1 parameter

How's my code:

 @GET("posts")
    Call<ModelJson[]> ouvirMensagens(int page);

How could I mount the url without using a @Query ("") by mounting the url in the format below?

link

    
asked by anonymous 17.05.2018 / 19:37

1 answer

0

One of the first examples of documentation :

@GET("group/{id}/users")
Call<List<User>> groupList(@Path("id") int groupId);

In your case:

@GET("posts/{page}")
Call<ModelJson[]> ouvirMensagens(@Path("page") int page);
    
18.05.2018 / 22:09