This is the API URL for deleting a record
GET : localhost:4000/course/delete/5bd9a270c6a31620e0b7b3d8
5bd9a270c6a31620e0b7b3d8 is an ID which is there in server and model class. I want call an API and pass it dynamically to url for deleting the record.
how to write an interface call request
@GET("course/delete/?id?") //how to write
Call<List<Course>> deleteRecords();
Responses will be appreciated
Just do it:
@GET("course/delete/{id}")
Call<List<Course>> deleteRecords(@Path("id") String id);
And then call:
retrofit.deleteRecords("5bd9a270c6a31620e0b7b3d8");
Try this definition
@GET("course/delete/{id}")
Call<List<Course>> deleteRecords(@Path("id") String id));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With