0
Je dois appeler un api utilisant retrofit 2 dans android. mais sans valeurs. Quand je fais cela, cela montre qu'il doit y avoir au moins 1 @field. Voici le code que j'utilise.Comment envoyer un appel post-retrofit 2 sans paramètres
public interface gitAPI {
@FormUrlEncoded
@POST("/MembersWS.svc/GetMemberAvailability/MBR0011581")
Call<Questions[]> loadQuestions();
}
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://192.168.1.99:82")
.addConverterFactory(GsonConverterFactory.create())
.build();
// prepare call in Retrofit 2.0
gitAPI stackOverflowAPI = retrofit.create(gitAPI.class);
Call<Questions[]> call = stackOverflowAPI.loadQuestions();
call.execute();
essayer d'enlever l'annotation @FormUrlEncoded –