@DELETE method is not supporting(Non-body HTTP method cannot contain @Body or @TypedOutput.)

sandy picture sandy · Jun 21, 2016 · Viewed 24.2k times · Source
@DELETE("/job/deletejob")
 Observable<JobDeleteResponseModel> jobDelete( @Body JobDeleteRequestModel model);

am getting this error:

Non-body HTTP method cannot contain @Body or @TypedOutput

can any one help me to come out from this??

Answer

AndroidEx picture AndroidEx · Jun 21, 2016

I've used this official workaround recently:

@HTTP(method = "DELETE", path = "/job/deletejob", hasBody = true)
Observable<JobDeleteResponseModel> jobDelete(@Body JobDeleteRequestModel model);