@Target([AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER]) class HTTP
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);
}
HTTP(method: String, path: String, hasBody: Boolean)
Use a custom HTTP verb for a request. This annotation can also used for sending DELETE with a request body:
|
val hasBody: Boolean |
|
val method: String |
|
val path: String
A relative or absolute path, or full URL of the endpoint. This value is optional if the first parameter of the method is annotated with |