Which HTTP method is used to delete a resource in REST?

Which HTTP method is used to delete a resource in REST?

A) DELETE
B) GET
C) POST
D) PUT

Answer:

A) DELETE

Explanation:

The DELETE method in REST is used to delete a resource on the server. When a client sends a DELETE request, it specifies the resource to be removed by its URL. The server then deletes the resource and may return a response indicating the result of the operation.

DELETE requests are idempotent, meaning that sending the same DELETE request multiple times will have the same effect as sending it once—once the resource is deleted, further DELETE requests will not change the server state.

Reference links:

https://www.javaguides.net/p/rest-api-tutorial.html

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top