Posts

Sending DELETE Requests in Postman: A Step-by-Step Guide

This tutorial aims to create a DELETE request in Postman and demonstrate how to execute it.

Table of Contents

What is a DELETE Request?

A DELETE request is an HTTP method used to delete a resource from a server. When a client sends a DELETE request, it specifies the resource to be removed by its URL. The server processes the request and deletes the specified resource if it exists.

Request URL
https://restful-booker.herokuapp.com/booking/bookingid

Implementation Steps

Make a collection

Please follow this post to learn how to create a Collection in Postman

Make a request to the Collection

Step 1: To create a new request, click on the 3 dots and select “Add request”.

Step 2: Once you create a new request, then you will get the following window:
Uploading: 183425 of 183425 bytes uploaded.

Provide the requested information.

Step 1: Enter the “name” in the request. Here, the name is “Delete Booking”.

Step 2: Enter the “URL” in the address bar. Add the "bookingid" after "booking/" in the URL. You will get this "bookingid" from the Create Booking request.


Step 3:
 
Now, select the “Delete” request from the list of request methods.
This is done to ensure that we send the request in the correct format that the server expects. The request body example mentioned at the beginning of the tutorial should be copied and pasted into the Postman request body. 
Step 4:: Press the “Send” button.


           Response

Now, it is showing that an access token is required. The HTTP status code '403 Forbidden—You don't have permission to access this resource' is displayed when a web server recognizes a user's request but cannot allow additional access.

Please follow this post to learn how to generate an access token.

Step 5:: Add 'Access Token' in this request

    Click on the 'Headers'
    Set the Query Params key as Cookie and set the Value to 'token=token value'

    Press the “Send” button.

Verify After Deletion


Congratulations on finishing this tutorial and I hope you found it helpful! Happy learning!

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.