I have a new Android project that I'm working on, and Retrofit2 works well for me. However, I have one URL that I need to click, on one of two lines, on top of the data I send.
Now it looks like this:
@FormUrlEncoded @POST("token") Call<AccessResponse> requestAccess(@Field("grant_type") String type, @Field("code") String authCode, @Field("client_id") String ApiKey);
grant type is only one of two things, and I would like to distract it in static URLs, for example:
@FormUrlEncoded @POST("token") @Field("grant_type","type1") Call<AccessResponse> requestAccess( @Field("code") String authCode, @Field("client_id") String ApiKey); @FormUrlEncoded @POST("token") @Field("grant_type","type2") Call<AccessResponse> refreshAccess( @Field("code") String authCode, @Field("client_id") String ApiKey);
Is there any way to do this? my 2 days google-fu did not work for me and did not browse documents and API code. I just don't want to track the correct line in different places of my code.
mix3d source share