1

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

Subin Babu
  • 1,515
  • 2
  • 24
  • 50

1 Answers1

1

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.

Paraskevas Ntsounos
  • 1,755
  • 2
  • 18
  • 34