DELETE 请求 运行 两次
DELETE request running twice
我正在 运行使用 Django 创建一个站点,我只能访问后端。
当我通过 Web 界面(警报)删除项目时,DELETE
请求是 运行 两次:
/alerts/[alert_id]
Request Method: DELETE
Status Code: 301 Moved Permanently
然后
/alerts/[alert_id]/
Request Method: DELETE
Status Code: 204 No Content
关于问题可能出在哪里或为什么会这样有任何想法吗?显然前端只调用以斜线结尾的请求(第二个)
我的错,docs 解释了问题,我只是不知道我在找什么
if the request URL does not match any of the patterns in the URLconf and it doesn’t end in a slash, an HTTP redirect is issued to the same URL with a slash appended.
HTTP 204 No Content
成功状态响应代码表示请求已成功,但客户端不需要离开其当前页面。 204
响应默认是可缓存的。此类响应中包含 ETag header。
常见用例是 return 204
作为 PUT 请求的结果,更新资源,而不更改显示给用户的页面的当前内容。
我正在 运行使用 Django 创建一个站点,我只能访问后端。
当我通过 Web 界面(警报)删除项目时,DELETE
请求是 运行 两次:
/alerts/[alert_id]
Request Method: DELETE
Status Code: 301 Moved Permanently
然后
/alerts/[alert_id]/
Request Method: DELETE
Status Code: 204 No Content
关于问题可能出在哪里或为什么会这样有任何想法吗?显然前端只调用以斜线结尾的请求(第二个)
我的错,docs 解释了问题,我只是不知道我在找什么
if the request URL does not match any of the patterns in the URLconf and it doesn’t end in a slash, an HTTP redirect is issued to the same URL with a slash appended.
HTTP 204 No Content
成功状态响应代码表示请求已成功,但客户端不需要离开其当前页面。 204
响应默认是可缓存的。此类响应中包含 ETag header。
常见用例是 return 204
作为 PUT 请求的结果,更新资源,而不更改显示给用户的页面的当前内容。