retrofit / retrofit2.http / HTTP / <init>

<init>

HTTP(method: String, path: String, hasBody: Boolean)

Use a custom HTTP verb for a request.


  interface Service {
    @HTTP(method = "CUSTOM", path = "custom/endpoint/")
    Call<ResponseBody> customEndpoint();
  }
  
This annotation can also used for sending DELETE with a request body:

  interface Service {
    @HTTP(method = "DELETE", path = "remove/", hasBody = true)
    Call<ResponseBody> deleteObject(@Body RequestBody object);
  }