How to add to add a parameter with two values using retrofit?

4051 views java
-2

this is the url:

/survey/add?moderator_id=1&password=123456&visitor_name=nabil&visitor_mobile=123456&entity_id=32&visitor_gender=male&survey={"opinion":"great event","answers":[{"answer":1,"question_id":9},{"answer":1,"question_id":10},{"answer":1,"question_id":11}]}

i want to add the last parameter to the my post request, how to do that!

this is the post request: public interface Serviecs {

@POST("survey/{add}")
@FormUrlEncoded
Call<SubmitSurvey> getSubmit(@Path("add") String add,
                             @Field("moderator_id") int moderator_id,
                             @Field("visitor_name") String visitor_name,
                             @Field("visitor_mobile") String visitor_mobile,
                             @Field("entity_id") int entity_id,
                             @Field("visitor_gender") String visitor_gender
);

}

answered question

1 Answer

4

Call<SubmitSurvey> getSubmit(@Path("add") String add,
                             @Field("moderator_id") int moderator_id,
                             @Field("visitor_name") String visitor_name,
                             @Field("visitor_mobile") String visitor_mobile,
                             @Field("entity_id") int entity_id,
                             @Field("visitor_gender") ReqAnsQues visitor_gender
);

And the structure of ReqAnsQues

Class ReqAnsQues{
     @SerializedName("answer")
     String answer;
     @SerializedName("visitor_gender")
     String visitorGender; 
}

posted this

Have an answer?

JD

Please login first before posting an answer.