- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a DELETE request in Postman?
Postman DELETE request deletes a resource already present in the server. The DELETE method sends a request to the server for deleting the request mentioned in the endpoint. Thus it is capable of updating data on the server.
Before creating a DELETE request, we shall first send a GET request to the server on the endpoint :http://dummy.restapiexample.com/api/v1/employees.
On applying the GET method, the below Response Body is obtained.
Let us delete the record of id 2 from the server.
Create a DELETE Request
Step 1 − Click on the New menu from the Postman application. The Create New pop-up comes up. Then click on the Request link.
Step 2 − SAVE REQUEST pop-up comes up. Enter Request name then click on Save.
Step 3 − The Request name (Test1) gets reflected on the Request tab. We shall select the option DELETE from the HTTP request dropdown. Then enter the URL - http://dummy.restapiexample.com/api/v1/delete/2 (endpoint for deleting the record of id 2) in the address bar.
Here, in the DELETE request, we have mentioned the id of the resource in the server which we want to delete in the URL.
Step 4 − Click on the Send button.
Response
Once a request has been sent, we can see the Response code 200 OK populated in the Response. This signifies a successful request and the request we have sent has been accepted by the server.
Also, information on the time consumed to complete the request (734 ms) and payload size (652 B) are populated. The Response shows the status as success. The record id 2 gets deleted from the server.
After deletion of the record with id 2, if we run the GET request on the endpoint − http://dummy.restapiexample.com/api/v1/employee/2, we shall receive 401 Unauthorized status code.
- Related Articles
- How to create a PUT request in Postman?
- How to create a POST request in Postman?
- How to see request logs in Postman console?
- How to use Global Variable in Postman Request?
- How to set Multiple Tests for a Request in Postman with JavaScript Method?
- What is Pre-Request Script in Postman?
- How to create a mock server in Postman?
- How to create a Global Variable in Postman?
- How to create sessions in Postman?
- How to share Session ID Cookie with another request using Postman?
- How to create and save a collection in Postman?
- How to Create an Environment in Postman?
- Explain DELETE request in Rest Assured.
- Creating Variables using Pre Request Script using Postman?
- How to set a global variable in Postman?
