Search code examples
androidretrofitrobospice

Is it possible to set a post name param dynamically using Robospice + Retrofit?


I'm trying to change name of the post param dynamically.

    @FormUrlEncoded
    @POST("/payment/send_rc")
    Abuse setTop(@Field("MrchLogin") String login,
                 @Field("OutSum") int sum,
                 @Field("InvId") int invId,
                 @Field("Desc") String paymentDescription,
                 @Field("shp_payment_no") int adtId,
                 @Field("shp_type") int number,
                 @Field("shp_user") int userID,
                 @Field("shp_month[]") int monthPeriod);

This is my method that I'm using and I'm trying to set monthPeriod field with dynamic name. So it can be something like shp_month[n] where n is my custom integer param name. So is this possible to change name of the post field dynamically?


Solution

  • As Jake Wharton said

    You can use a "@FieldMap Map<String, String>" for that.
    

    Looks like Robospice Retrofit module is out of date.