Apparently HttpClient doesn't support sending a request body with DELETE. Fixing.
This commit is contained in:
@@ -55,8 +55,9 @@ namespace WD7UVN_HFT_2023241.Endpoint
|
|||||||
LogicServices.CRUDOperations.UpdateCustomer(e);
|
LogicServices.CRUDOperations.UpdateCustomer(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete()]
|
//HttpClient does not support sending data in the body of a DELETE request. Instead, we can send the data in the URL like with a GET request.
|
||||||
public void DeleteCustomer([FromBody] int id)
|
[HttpDelete("{id}")]
|
||||||
|
public void DeleteCustomer(int id)
|
||||||
{
|
{
|
||||||
LogicServices.CRUDOperations.DeleteCustomer(id);
|
LogicServices.CRUDOperations.DeleteCustomer(id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,8 +55,9 @@ namespace WD7UVN_HFT_2023241.Endpoint
|
|||||||
LogicServices.CRUDOperations.UpdateEmployee(e);
|
LogicServices.CRUDOperations.UpdateEmployee(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete()]
|
//HttpClient does not support sending data in the body of a DELETE request. Instead, we can send the data in the URL like with a GET request.
|
||||||
public void DeleteEmployee([FromBody] int id)
|
[HttpDelete("{id}")]
|
||||||
|
public void DeleteEmployee(int id)
|
||||||
{
|
{
|
||||||
LogicServices.CRUDOperations.DeleteEmployee(id);
|
LogicServices.CRUDOperations.DeleteEmployee(id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,8 +55,9 @@ namespace WD7UVN_HFT_2023241.Endpoint
|
|||||||
LogicServices.CRUDOperations.UpdateMaintainerTeam(e);
|
LogicServices.CRUDOperations.UpdateMaintainerTeam(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete()]
|
//HttpClient does not support sending data in the body of a DELETE request. Instead, we can send the data in the URL like with a GET request.
|
||||||
public void DeleteMaintainerTeam([FromBody] int id)
|
[HttpDelete("{id}")]
|
||||||
|
public void DeleteMaintainerTeam(int id)
|
||||||
{
|
{
|
||||||
LogicServices.CRUDOperations.DeleteMaintainerTeam(id);
|
LogicServices.CRUDOperations.DeleteMaintainerTeam(id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,8 +55,9 @@ namespace WD7UVN_HFT_2023241.Endpoint
|
|||||||
LogicServices.CRUDOperations.UpdateService(e);
|
LogicServices.CRUDOperations.UpdateService(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete()]
|
//HttpClient does not support sending data in the body of a DELETE request. Instead, we can send the data in the URL like with a GET request.
|
||||||
public void DeleteService([FromBody] int id)
|
[HttpDelete("{id}")]
|
||||||
|
public void DeleteService(int id)
|
||||||
{
|
{
|
||||||
LogicServices.CRUDOperations.DeleteService(id);
|
LogicServices.CRUDOperations.DeleteService(id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user