@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??
@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??
Kotlin Code :
path
is not required if your first argument to interface method is a url annotated with @Url
Example :
@HTTP(method = "DELETE", hasBody = true)
fun deleteStudentFromDatabase(
@Url url: String,
@Body payload: StudentModel
): Observable<Any>
If first argument to interface method is not a url then use this
@HTTP(method = "DELETE", path = "{urlPath}", hasBody = true)
fun deleteStudentFromDatabase(
@Body payload: StudentModel,
@Path("urlPath") url: String
): Observable<Any>
Change
@DELETE("/job/deletejob")
Observable<JobDeleteResponseModel> jobDelete( @Body JobDeleteRequestModel model);
to
@HTTP(method = "DELETE", path = "/job/deletejob", hasBody = true)
Observable<JobDeleteResponseModel> jobDelete( @Body JobDeleteRequestModel model);
The difference is in
@DELETE("/job/deletejob") // For DELETE without body
@HTTP(method = "DELETE", path = "/job/deletejob", hasBody = true) // For DELETE with body