delete
If you want to delete any records or all records so we use DELETE
method.
#
Delete All DataIf you want remove all data (truncate table) so here we pass table with all=true parameter, which is confirm that user is really want to delete data.
DELETE | api.example.com/users?all=true
{ "status":true, "message":"All data has been deleted"}
It can delete the complete records from table.
#
Delete specific dataIf you want to delete perticular data from users
table, like you want to delete data for user who have id=1. so we just normaly pass data with Json body.
DELETE | api.example.com/users
body
{ "id":1}
return
{ "status":true, "message":"Data has been deleted"}
It will delete the record who have id=1.