Hello! I have already read about a dozen guides on Retrofit2, but all of them explain only sending simple @GET @POST requests and I still don’t understand how to set the request I need, so I ask for help from knowledgeable people.
Actually such a request I want to ask using Retrofit2 " https://translate.yandex.net/api/v1.5/tr.json/translate?lang= " + lang + "&" + "text =" + text + "&" + API_KEY
// String lang specifies which language to translate // String text tex we are translating
As I understand it in the class where we create a Retrofit object, BASE_URL = " https://translate.yandex.net/ ";
In the interface
@GET("/api/v1.5/tr.json/translate?") Call<TranslationResponce>translateText(@Query("lang")String lang, @Query("text")String text, @Query("api_key")String apiKey); But apparently I do not understand correctly, since this query does not work. Please poke your nose, what am I doing wrong? Thank you in advance!
@Query("api_key")with@Query("key"). Another parameter "lang" should contain the translation direction ('en-ru' for example) - woesss