When I try to create a delete method:
public interface ImageService {
@DELETE(\"api/v1/attachment\")
Call delete(@Body DeleteMode
In case you are you are using an old version that doesn't support @HTTP, you can also add another interface that implements the @RestMethod
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import retrofit.http.RestMethod;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** Make a DELETE request to a REST path relative to base URL with body. */
@Target(METHOD)
@Retention(RUNTIME)
@RestMethod(value = "DELETE", hasBody = true)
public @interface DELETEWITHBODY {
String value();
}
And then the usage becomes:
public interface ImageService {
@DELETEWITHBODY("api/v1/attachment")
Call delete(@Body DeleteModel deleteModel);
}