Postman DELETE requests behaving like GET requests

App Details:

Postman for Linux
Version 7.0.7
linux 4.9.0-8-amd64 / x64

Issue Report:

  1. Did you encounter this recently, or has this bug always been there:
    I believe this bug has always been there, certainly on my current version
  2. Expected behaviour:
    When sending a DELETE request to my site, Postman behaves as if it was a GET request, and does not delete the item
  3. Console logs:
DELETE
http://127.0.0.1:6942/devices/787022c7-cff7-4c5e-9206-b71283002f2f
11:32:45.450

Request Headers:
cache-control:"no-cache"
Postman-Token:"533df8e4-66b3-488c-a90a-683fa74b9620"
User-Agent:"PostmanRuntime/7.6.1"
Accept:"*/*"
accept-encoding:"gzip, deflate"
referer:"http://127.0.0.1:6942/devices/787022c7-cff7-4c5e-9206-b71283002f2f"
Response Headers:
Server:"gunicorn/19.9.0"
Date:"Tue, 09 Apr 2019 09:32:45 GMT"
Connection:"close"
Content-Type:"application/json"
Vary:"Accept, Cookie"
Allow:"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"
Content-Length:"345"
X-Frame-Options:"SAMEORIGIN"
Response Body:
id:"787022c7-cff7-4c5e-9206-b71283002f2f"
number:2
name:"Device 2"
last_received_battery_percentage:42
last_received_position_latitude:-33
last_received_position_longitude:151
last_received_position_radius:1000
last_received_position_is_from_atlas:true
last_received_city_name:"Whittingham"
last_received_temperature:21

Also note my test failure:
Status code is 204 | AssertionError: expected response to have status code 204 but got 200

To reproduce the problem simply call a DELETE request and verify whether the item has been deleted.
The bug does not come from my API as it behaves as expected when sending requests via curl.
I tried turning off the redirect, the only difference was that the device was not listed on the DELETE request, but was still not actually deleted.

When I make a DELETE call from your postman app to https://postman-echo.com/delete I get:

{
    "args": {},
    "data": {},
    "files": {},
    "form": {},
    "headers": {
        "x-forwarded-proto": "https",
        "host": "postman-echo.com",
        "accept": "*/*",
        "accept-encoding": "gzip, deflate",
        "cache-control": "no-cache",
        "cookie": "sails.sid=s%3A8YPbr28_BB1JtlaYJrsay4U_GOVflxtj.pPVnIHt8zkSEMw8XtT3utxXo92Csq4QASpgb8ve0QOI",
        "postman-token": "9cb31b3e-2ed9-437c-b994-f638a379564b",
        "user-agent": "PostmanRuntime/7.6.1",
        "x-forwarded-port": "443"
    },
    "json": null,
    "url": "https://postman-echo.com/delete"
}

and in the console I have:

DELETE
https://postman-echo.com/delete
13:44:35.796

Request Headers:
cache-control:"no-cache"
Postman-Token:"9cb31b3e-2ed9-437c-b994-f638a379564b"
User-Agent:"PostmanRuntime/7.6.1"
Accept:"*/*"
Host:"postman-echo.com"
cookie:"sails.sid=s%3A8YPbr28_BB1JtlaYJrsay4U_GOVflxtj.pPVnIHt8zkSEMw8XtT3utxXo92Csq4QASpgb8ve0QOI"
accept-encoding:"gzip, deflate"
content-length:""
Response Headers:
Content-Encoding:"gzip"
Content-Type:"application/json; charset=utf-8"
Date:"Thu, 11 Apr 2019 11:44:35 GMT"
ETag:"W/"1c6-26IRTbXUcjpABswIJyHqMiM9rA0""
Server:"nginx"
set-cookie:"sails.sid=s%3ACqqY9kvbmOk426328nqcVx2bEahPSldF.vu9NY81Jr%2FD2Z8Ny7rJiDacOqAFRAYgUUVM%2FyWtKYRs; Path=/; HttpOnly"
Vary:"Accept-Encoding"
Content-Length:"339"
Connection:"keep-alive"
Response Body:
args:
data:
files:
form:
headers:
json:null
url:"https://postman-echo.com/delete"

Has anyone else had this issue?

1 Like

I m facing the same issue

Hey @payload-cosmologist3

As it’s 2 years later and a lot of things have happened to the platform in that time - it’s probably best to explain your specific problem, happening in your context.

Please provide as much detail as possible. :trophy:

I tried to request a delete method but returns get method

I’m not actually sure what you’re trying to show there :thinking:

Can you explaining step by step what you’re doing and what you’re seeing, please? Without more context and detail, I don’t believe anyone is going to be able to help you here.

More information about the type of details you should be providing can be found here:

when i run
[Delete]:qm.docca.in/api/resource/Lead/victory Hospital
It gives me a response of 200 but wont get deleted, it outputs the GET method instead

  • Is that a duplicate of the brand request, which is a GET?
  • What happens when you save that request, does it change the method and name in the sidebar?
  • Have you tried opening a new tab and recreating DELETE request there?

Context wise, I have absolutely no idea what that request should be doing or returning.

Put a “/” at the end of the path. Be careful to enter an exact path match for the post, including end bars.

2 Likes

@alberto-campos , adding the “/” at the end of the path in postman (haven’t modified anything inmy code concerning the urls) actually solved the issue in my case. Without it, my DELETE request was actually considered and treated like a GET request.

I also had this problem. For me it seemed to be related to a caching issue with the environment config.

When I updated & reset my environment config (the hostname was stored there), it then sent a DELETE request instead of GET.

I hope this helps.