Android : how to add multiple lines which are an array of the same parameter in retrofit?

on Wednesday, October 1, 2014


I want to pass an array of the same element, but i want them to be passed as new fields. I want to do something like:



@POST("/api/userInfo/changeProfileData/")
void updateProfile(
@Field("userInfoProfile[languages][0]") String language1,
@Field("userInfoProfile[languages][1]") String language2,
Callback<BaseModel<StateModel>> callback);


But the problem is that i don't know the number of elements so i cannot do like above.


I tried to pass a list:



@Field("userInfoProfile[languages]") List<String> languages


but the value is not valid because i need fields with their index (userInfoProfile[languages][0]).


0 comments:

Post a Comment