Reputation: 1555
I have two methods to call an API.
1.POST
2.PUT
Currently, i keep the two versions like
@POST("api_end_point")
Call<ProfessionalResponse> ProfessionalData(
@Header("Authorization") String authorization,
@Body ProfessionalInsertData body);
@PUT("api_end_point")
Call<ProfessionalResponse> ProfessionalData(
@Header("Authorization") String authorization,
@Body ProfessionalInsertData body);
How can I reduce this to a single function or single call in java or kotlin
Upvotes: 1
Views: 659
Reputation: 1777
It is not possible. You can check this issue from github. As comment said it is better to use for this service OkHttp directly which allows you to control all aspects of the HTTP request dynamically.
Upvotes: 1