我正在使用Teamcity REST API使用以下Python代码片段标记构建。但是我得到了500个状态代码。
post_data = {"uri": "http://localhost:81/httpAuth/app/rest/builds/id:39/tags/", "name": "xxx"}
data = urllib.urlencode(post_data)
request = urllib2.Request(url, data)
这是curl命令,用于标记我要使用urllib2实现的构建。
curl -v -u user:password --request POST --header "Content-Type: application/xml" --data "<tags><tag name='xxx'/></tags>" "http://localhost:81/httpAuth/app/rest/builds/id:39/tags/