对 Stash 标签的删除请求

DELETE request on Stash tags

这道题和类似,总体来说很简单,但不知为何找不到正确的答案。

我正在使用 Stash REST API 更新 Stash 存储库中的标签。发送 POST 请求并添加新标签很容易(例如 python 请求,但可以与 curl 相同):

#!/usr/bin/python3.5

import requests

url = '.../rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags'

data = {'force': 'false',
        'message': 'Updated tag',
        'name': 'LATEST_SUCCESSFUL',
        'startPoint': 'ffffff',
        'type': 'LIGHTWEIGHT'}

headers = {'Content-Type': 'application/json',
           'X-Atlassian-Token': 'no-check'}

r = requests.post(url, data=data, header=headers)

这工作正常,但我想保留远程删除此标签的选项。根据文档 https://developer.atlassian.com/static/rest/stash/3.11.6/stash-scm-git-rest.html?_ga=1.6600434.1354597480.1483944905 这应该有效:

url = '.../rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags/LATEST_SUCCESSFUL
r = requests.delete(url)

但是我在这里遇到 404 错误。那么问题来了,访问(和删除)单个标签的正确方法是什么?

答案很简单,标签删除请求应该命中

rest/git/1.0/...

而不是

rest/api/1.0/...

但后一种方法适用于 get 请求。