- Postman - Discussion
- Postman - Useful Resources
- Postman - Quick Guide
- Postman - OAuth 2.0 Authorization
- Postman - Run Collections using Newman
- Postman - Newman Overview
- Postman - Sessions
- Postman - Cookies
- Postman - Mock Server
- Postman - Assertion
- Postman - Collection Runner
- Postman - Parameterize Requests
- Postman - Create Collections
- Postman - Create Tests for CRUD
- Postman - DELETE Requests
- Postman - PUT Requests
- Postman - POST Requests
- Postman - GET Requests
- Postman - Workflows
- Postman - Authorization
- Postman - Environment Variables
- Postman - Environment Setup
- Postman - Introduction
- Postman - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Postman - DELETE Requests
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:
. The details on how to create a GET request is explained in detail in the Chapter onGET Requests.On applying the GET method, the below Response Body is obtained −
Let us delete the record of the id 2 from the server.
Create a DELETE Request
Follow the steps given below to create a DELETE request in Postman successfully −
Step 1 − Cpck on the New menu from the Postman apppcation. The Create New pop-up comes up. Then, cpck on the Request pnk.
Step 2 − SAVE REQUEST pop-up comes up. Enter the Request name then cpck 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 -
(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 − Cpck 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:
, we shall receive 401 Unauthorized status code. Advertisements