0
0
Postmantesting~5 mins

DELETE request in Postman

Choose your learning style9 modes available
Introduction

A DELETE request is used to remove data from a server. It helps keep data clean and up-to-date by deleting unwanted or old information.

When you want to remove a user account from a website.
When deleting a product from an online store's inventory.
When clearing old messages or notifications in an app.
When removing a file or record from a database.
When testing if the API correctly deletes data as expected.
Syntax
Postman
DELETE /resource/{id} HTTP/1.1
Host: example.com
Authorization: Bearer <token>

The URL usually includes the ID of the item to delete.

Authorization is often required to confirm permission to delete.

Examples
This deletes the user with ID 123.
Postman
DELETE /users/123 HTTP/1.1
Host: api.example.com
Authorization: Bearer abc123token
This deletes the product with ID 456.
Postman
DELETE /products/456 HTTP/1.1
Host: api.example.com
Authorization: Bearer abc123token
Sample Program

This request deletes the todo item with ID 10 from the server.

The server should respond with a success status code indicating the item was deleted.

Postman
DELETE /todos/10 HTTP/1.1
Host: jsonplaceholder.typicode.com
OutputSuccess
Important Notes

Some servers return 204 No Content to show deletion succeeded without returning data.

Always check the response status code to confirm deletion.

Be careful: DELETE requests remove data permanently.

Summary

DELETE requests remove specific data from a server.

They usually include the item ID in the URL.

Check the response status to confirm success.