Pass more than one parameter through URL

0

I have the following code:

public interface service {

        @GET("?acao=R&tipo_refeicao={tipo}&data={data}")
        public void getCardapio(
           Callback<List<Cardapio>> getCardapio(@Query("tipo") int tipo, @Query("data") String data);
        )

}

How do I pass more than one parameter?

I want to pass int and string which is a date. Would that be correct?

How would the correct one be?

    
asked by anonymous 31.07.2017 / 23:41

1 answer

1

How do I explain this question of how to create a model to receive the values properly, how do I pass some parameters, you can use @Query . See below

@GET("/restaurante")
Call<Cardapio.Conteudo> getCardapio(@Query("tipo") int tipo, @Query("data") String data);

Below is an example of the result of the above call:

/restaurante?tipo=SALADAS&data=2017-08-01

I also answered another question example also using @Path , which would be another alternative to solve your problem. For more details and examples, see more about Query in the documentation .

    
01.08.2017 / 15:36