android - Sending multiple dynamic fields with Retrofit -
we need send post request web service needs dynamic multiple fields.
i mean, need send post request:
question1='answer1'&question2='answer1'&question2='answer2'&question3='answer1'
where question1 , question2 not set in compilation time. know can use @fieldmap using dynamic fields, cannot send same field more 1 time.
this our retrofit code:
@formurlencoded @post("/desafios/send/") observable<baseservermsgarray> postsubmitsurvey(@field("customerid") long customerid, @field("upload_from_app") int uploadfromapp, @fieldmap hashmap<string, arraylist<string>> hashfields);
could us?
thanks in advance,
what need map can contain duplicate keys. unfortunately there no such map in standard android. might use onehttps://github.com/greenrobot/essentials/blob/master/java-essentials/src/main/java/org/greenrobot/essentials/collections/multimap.java
if won't work, try manually convert questions string , send formatted string.
Comments
Post a Comment